From 691c33f8d97b0c9475dded636f0b127bb0cabd00 Mon Sep 17 00:00:00 2001 From: water111 <48171810+water111@users.noreply.github.com> Date: Sat, 8 Jan 2022 15:09:00 -0500 Subject: [PATCH] [goos] fix pretty printer bugs, update ref after pretty printer changes (#1063) * update ref after pretty printer changes * another try --- common/goos/PrettyPrinter2.cpp | 26 +- .../reference/engine/ambient/ambient_REF.gc | 71 +- .../reference/engine/ambient/mood_REF.gc | 18 +- .../reference/engine/anim/joint_REF.gc | 35 +- .../engine/camera/cam-combiner_REF.gc | 7 +- .../reference/engine/camera/cam-layout_REF.gc | 201 +- .../reference/engine/camera/cam-master_REF.gc | 144 +- .../engine/camera/cam-states-dbg_REF.gc | 49 +- .../reference/engine/camera/cam-states_REF.gc | 253 ++- .../reference/engine/camera/camera_REF.gc | 28 +- .../engine/camera/math-camera_REF.gc | 4 +- .../reference/engine/camera/pov-camera_REF.gc | 58 +- .../engine/collide/collide-touch_REF.gc | 3 +- .../reference/engine/data/res_REF.gc | 42 +- .../reference/engine/debug/anim-tester_REF.gc | 46 +- .../reference/engine/debug/debug_REF.gc | 33 +- .../engine/debug/default-menu_REF.gc | 13 +- .../reference/engine/debug/viewer_REF.gc | 22 +- .../reference/engine/dma/dma-disasm_REF.gc | 9 +- .../engine/draw/process-drawable_REF.gc | 94 +- .../reference/engine/engine/connect_REF.gc | 7 +- .../engine/entity/actor-link-h_REF.gc | 3 +- .../reference/engine/entity/relocate_REF.gc | 70 +- .../reference/engine/game/collectables_REF.gc | 349 ++-- .../reference/engine/game/crates_REF.gc | 62 +- .../engine/game/effect-control_REF.gc | 46 +- .../reference/engine/game/game-info_REF.gc | 32 +- .../reference/engine/game/game-save_REF.gc | 25 +- .../reference/engine/game/generic-obs_REF.gc | 106 +- .../reference/engine/game/main_REF.gc | 104 +- .../reference/engine/game/powerups_REF.gc | 90 +- .../reference/engine/game/projectiles_REF.gc | 52 +- .../reference/engine/game/settings_REF.gc | 21 +- .../engine/game/task/hint-control_REF.gc | 45 +- .../engine/game/task/process-taskable_REF.gc | 145 +- .../engine/game/task/task-control_REF.gc | 841 ++++----- .../reference/engine/game/voicebox_REF.gc | 29 +- .../engine/geometry/bounding-box_REF.gc | 30 +- .../reference/engine/geometry/geometry_REF.gc | 6 +- .../reference/engine/gfx/background_REF.gc | 15 +- .../reference/engine/gfx/depth-cue_REF.gc | 15 +- .../reference/engine/gfx/hw/display_REF.gc | 7 +- .../engine/gfx/ocean/ocean-transition_REF.gc | 22 +- .../reference/engine/gfx/shadow/shadow_REF.gc | 13 +- .../reference/engine/gfx/sky/sky-tng_REF.gc | 7 +- .../gfx/sparticle/sparticle-launcher_REF.gc | 7 +- .../reference/engine/gfx/sprite/sprite_REF.gc | 7 +- .../reference/engine/gfx/texture_REF.gc | 38 +- .../engine/gfx/tfrag/tfrag-methods_REF.gc | 7 +- .../reference/engine/gfx/tfrag/tfrag_REF.gc | 19 +- .../engine/gfx/tie/tie-methods_REF.gc | 28 +- .../reference/engine/gfx/tie/tie_REF.gc | 40 +- .../reference/engine/gfx/time-of-day_REF.gc | 41 +- .../reference/engine/gfx/water/water_REF.gc | 161 +- .../reference/engine/level/level_REF.gc | 89 +- .../engine/level/load-boundary_REF.gc | 11 +- .../reference/engine/load/loader_REF.gc | 36 +- .../reference/engine/math/matrix_REF.gc | 88 +- .../reference/engine/math/quaternion_REF.gc | 20 +- .../reference/engine/math/transformq_REF.gc | 12 +- .../reference/engine/ps2/pad_REF.gc | 3 +- .../reference/engine/sound/gsound_REF.gc | 16 +- .../engine/target/joint-mod-h_REF.gc | 12 +- .../engine/target/logic-target_REF.gc | 274 ++- .../reference/engine/target/sidekick_REF.gc | 10 +- .../engine/target/target-death_REF.gc | 169 +- .../engine/target/target-part_REF.gc | 16 +- .../engine/target/target-util_REF.gc | 225 +-- .../reference/engine/target/target2_REF.gc | 716 ++++--- .../reference/engine/target/target_REF.gc | 1652 ++++++++--------- .../reference/engine/ui/hud-classes_REF.gc | 107 +- .../decompiler/reference/engine/ui/hud_REF.gc | 97 +- .../reference/engine/ui/progress-h_REF.gc | 2 +- .../engine/ui/progress/progress-draw_REF.gc | 53 +- .../reference/engine/ui/text_REF.gc | 22 +- .../reference/engine/util/sync-info_REF.gc | 22 +- .../reference/kernel/gkernel_REF.gc | 25 +- .../reference/kernel/gstring_REF.gc | 29 +- .../reference/levels/beach/beach-obs_REF.gc | 93 +- .../reference/levels/beach/beach-rocks_REF.gc | 21 +- .../reference/levels/beach/lurkercrab_REF.gc | 39 +- .../reference/levels/beach/lurkerpuppy_REF.gc | 9 +- .../reference/levels/beach/lurkerworm_REF.gc | 38 +- .../reference/levels/beach/pelican_REF.gc | 51 +- .../reference/levels/beach/sculptor_REF.gc | 9 +- .../reference/levels/beach/seagull_REF.gc | 27 +- .../levels/citadel/assistant-citadel_REF.gc | 30 +- .../levels/citadel/citadel-obs_REF.gc | 63 +- .../levels/citadel/citadel-sages_REF.gc | 7 +- .../levels/citadel/citb-drop-plat-CIT_REF.gc | 58 +- .../reference/levels/citadel/citb-plat_REF.gc | 118 +- .../levels/common/babak-with-cannon_REF.gc | 71 +- .../reference/levels/common/babak_REF.gc | 36 +- .../reference/levels/common/basebutton_REF.gc | 60 +- .../reference/levels/common/baseplat_REF.gc | 57 +- .../levels/common/battlecontroller_REF.gc | 34 +- .../levels/common/joint-exploder_REF.gc | 19 +- .../levels/common/launcherdoor_REF.gc | 34 +- .../levels/common/mistycannon_REF.gc | 61 +- .../reference/levels/common/nav-enemy_REF.gc | 310 ++-- .../reference/levels/common/orb-cache_REF.gc | 110 +- .../levels/common/plat-button_REF.gc | 70 +- .../reference/levels/common/plat_REF.gc | 65 +- .../reference/levels/common/rigid-body_REF.gc | 53 +- .../reference/levels/common/sharkey_REF.gc | 99 +- .../levels/common/static-screen_REF.gc | 19 +- .../reference/levels/common/water-anim_REF.gc | 6 +- .../levels/darkcave/darkcave-obs_REF.gc | 27 +- .../levels/finalboss/final-door_REF.gc | 59 +- .../levels/finalboss/green-eco-lurker_REF.gc | 21 +- .../levels/finalboss/light-eco_REF.gc | 43 +- .../levels/finalboss/robotboss-misc_REF.gc | 12 +- .../levels/finalboss/robotboss-weapon_REF.gc | 67 +- .../levels/finalboss/robotboss_REF.gc | 793 ++++---- .../finalboss/sage-finalboss-FIN_REF.gc | 24 +- .../firecanyon/assistant-firecanyon_REF.gc | 123 +- .../levels/firecanyon/firecanyon-obs_REF.gc | 97 +- .../levels/flut_common/flutflut_REF.gc | 41 +- .../levels/flut_common/target-flut_REF.gc | 732 ++++---- .../reference/levels/intro/evilbro_REF.gc | 14 +- .../reference/levels/jungle/darkvine_REF.gc | 30 +- .../reference/levels/jungle/fisher-JUN_REF.gc | 98 +- .../reference/levels/jungle/hopper_REF.gc | 26 +- .../levels/jungle/jungle-mirrors_REF.gc | 62 +- .../reference/levels/jungle/jungle-obs_REF.gc | 76 +- .../reference/levels/jungle/junglefish_REF.gc | 25 +- .../levels/jungle/junglesnake_REF.gc | 38 +- .../reference/levels/jungleb/aphid_REF.gc | 21 +- .../levels/jungleb/jungleb-obs_REF.gc | 18 +- .../levels/jungleb/plant-boss_REF.gc | 131 +- .../levels/lavatube/assistant-lavatube_REF.gc | 59 +- .../levels/lavatube/lavatube-energy_REF.gc | 178 +- .../levels/lavatube/lavatube-obs_REF.gc | 143 +- .../levels/maincave/baby-spider_REF.gc | 28 +- .../levels/maincave/driller-lurker_REF.gc | 87 +- .../reference/levels/maincave/gnawer_REF.gc | 112 +- .../levels/maincave/maincave-obs_REF.gc | 158 +- .../levels/maincave/mother-spider-egg_REF.gc | 5 +- .../levels/maincave/mother-spider_REF.gc | 130 +- .../levels/maincave/spiderwebs_REF.gc | 19 +- .../levels/misty/balloonlurker_REF.gc | 33 +- .../reference/levels/misty/bonelurker_REF.gc | 70 +- .../levels/misty/misty-conveyor_REF.gc | 38 +- .../reference/levels/misty/misty-obs_REF.gc | 34 +- .../levels/misty/misty-teetertotter_REF.gc | 34 +- .../levels/misty/misty-warehouse_REF.gc | 19 +- .../reference/levels/misty/muse_REF.gc | 44 +- .../levels/misty/quicksandlurker_REF.gc | 68 +- .../levels/ogre/flying-lurker_REF.gc | 105 +- .../reference/levels/ogre/ogre-obs_REF.gc | 50 +- .../collide-reaction-racer_REF.gc | 24 +- .../racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc | 325 ++-- .../target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc | 347 ++-- .../levels/robocave/cave-trap_REF.gc | 43 +- .../levels/robocave/spider-egg_REF.gc | 17 +- .../levels/rolling/rolling-obs_REF.gc | 88 +- .../levels/rolling/rolling-race-ring_REF.gc | 9 +- .../levels/rolling/rolling-robber_REF.gc | 139 +- .../reference/levels/snow/snow-bumper_REF.gc | 39 +- .../levels/snow/snow-flutflut-obs_REF.gc | 53 +- .../reference/levels/snow/snow-obs_REF.gc | 88 +- .../reference/levels/snow/snow-ram_REF.gc | 12 +- .../reference/levels/snow/target-ice_REF.gc | 212 +-- .../levels/snow/target-snowball_REF.gc | 5 +- .../reference/levels/snow/yeti_REF.gc | 43 +- .../reference/levels/sunken/bully_REF.gc | 56 +- .../levels/sunken/double-lurker_REF.gc | 98 +- .../levels/sunken/helix-water_REF.gc | 20 +- .../reference/levels/sunken/orbit-plat_REF.gc | 24 +- .../reference/levels/sunken/puffer_REF.gc | 115 +- .../reference/levels/sunken/qbert-plat_REF.gc | 18 +- .../reference/levels/sunken/shover_REF.gc | 9 +- .../levels/sunken/square-platform_REF.gc | 173 +- .../reference/levels/sunken/steam-cap_REF.gc | 7 +- .../levels/sunken/sun-exit-chamber_REF.gc | 122 +- .../levels/sunken/sun-iris-door_REF.gc | 7 +- .../reference/levels/sunken/sunken-obs_REF.gc | 17 +- .../levels/sunken/target-tube_REF.gc | 98 +- .../reference/levels/sunken/wall-plat_REF.gc | 46 +- .../reference/levels/swamp/billy_REF.gc | 185 +- .../reference/levels/swamp/kermit_REF.gc | 93 +- .../reference/levels/swamp/swamp-bat_REF.gc | 20 +- .../reference/levels/swamp/swamp-obs_REF.gc | 33 +- .../levels/swamp/swamp-rat-nest_REF.gc | 58 +- .../reference/levels/swamp/swamp-rat_REF.gc | 21 +- .../reference/levels/title/title-obs_REF.gc | 70 +- .../levels/training/training-obs_REF.gc | 86 +- .../levels/village1/assistant_REF.gc | 51 +- .../reference/levels/village1/explorer_REF.gc | 44 +- .../levels/village1/fishermans-boat_REF.gc | 93 +- .../reference/levels/village1/sage_REF.gc | 76 +- .../levels/village1/village-obs-VI1_REF.gc | 48 +- .../reference/levels/village1/yakow_REF.gc | 90 +- .../levels/village2/assistant-village2_REF.gc | 151 +- .../levels/village2/flutflut-bluehut_REF.gc | 57 +- .../reference/levels/village2/gambler_REF.gc | 16 +- .../levels/village2/sage-bluehut_REF.gc | 85 +- .../levels/village2/sunken-elevator_REF.gc | 40 +- .../levels/village2/swamp-blimp_REF.gc | 42 +- .../levels/village2/village2-obs_REF.gc | 95 +- .../levels/village3/assistant-village3_REF.gc | 8 +- .../reference/levels/village3/minecart_REF.gc | 16 +- .../reference/levels/village3/miners_REF.gc | 32 +- .../levels/village3/sage-village3_REF.gc | 5 +- .../levels/village_common/oracle_REF.gc | 12 +- .../levels/village_common/villagep-obs_REF.gc | 208 +-- test/test_pretty_print.cpp | 59 + 207 files changed, 8537 insertions(+), 8522 deletions(-) diff --git a/common/goos/PrettyPrinter2.cpp b/common/goos/PrettyPrinter2.cpp index 36bf99beec..a2bae23c69 100644 --- a/common/goos/PrettyPrinter2.cpp +++ b/common/goos/PrettyPrinter2.cpp @@ -68,6 +68,19 @@ struct Node { return false; } + std::string debug_to_string() const { + switch (kind) { + case Kind::ATOM: + return fmt::format("[atom {}]", atom_str); + case Kind::LIST: + return "[list]"; + case Kind::IMPROPER_LIST: + return "[improper list]"; + default: + assert(false); + } + } + // how wide is this text? not including the indentation of this subtree. u32 text_len = 0; @@ -190,7 +203,8 @@ void break_list(Node* node) { node->top_line_count = 1; const std::unordered_set sameline_splitters = { - "if", "<", ">", "<=", ">=", "set!", "=", "!=", "+", "-", "*", "/", "the", "->", "and", "or"}; + "if", "<", ">", "<=", ">=", "set!", "=", "!=", "+", "-", "*", + "/", "the", "->", "and", "or", "logand", "logior", "logxor", "+!", "*!", "logtest?"}; if (node->child_nodes.at(0).kind == Node::Kind::LIST) { // ((foo @@ -325,18 +339,26 @@ void append_node_to_string(const Node* node, int listing_indent = next_indent_level + node->quoted + node->sub_elt_indent; int extra_indent = 0; + int old_indent = listing_indent; + if (node->top_line_count) { + listing_indent -= node->sub_elt_indent; + listing_indent += node->child_nodes.front().kind == Node::Kind::LIST ? 1 : 2; + } for (; node_idx < node->top_line_count; node_idx++) { size_t s0 = str.length(); if (node->kind == Node::Kind::IMPROPER_LIST && &node->child_nodes.at(node_idx) == &node->child_nodes.back()) { str.append(". "); } + // so, if these need to break, they should have a bigger indent. append_node_to_string(&node->child_nodes.at(node_idx), str, 0, listing_indent + extra_indent); - // extra_indent += (str.length() - s0); extra_indent = compute_extra_offset(str, s0, extra_indent); str.push_back(' '); } + if (node->top_line_count) { + listing_indent = old_indent; + } if (node->top_line_count > 0) { str.pop_back(); } diff --git a/test/decompiler/reference/engine/ambient/ambient_REF.gc b/test/decompiler/reference/engine/ambient/ambient_REF.gc index 98fcfd4656..4512ca7b9d 100644 --- a/test/decompiler/reference/engine/ambient/ambient_REF.gc +++ b/test/decompiler/reference/engine/ambient/ambient_REF.gc @@ -225,15 +225,13 @@ ;; definition for function can-grab-display? (defun can-grab-display? ((arg0 process-taskable)) (let ((v1-2 (handle->process (-> *game-info* display-text-handle)))) - (when (and - (or (not v1-2) (= v1-2 arg0) (>= (- (-> *display* base-frame-counter) (-> *game-info* display-text-time)) 30)) - (and - *target* - (!= (-> *target* next-state name) 'target-look-around) - (zero? (logand (-> *target* state-flags) #x8008)) - (= *master-mode* 'game) - ) - ) + (when (and (or (not v1-2) (= v1-2 arg0) (>= (- (-> *display* base-frame-counter) (-> *game-info* display-text-time)) 30)) + (and *target* + (!= (-> *target* next-state name) 'target-look-around) + (zero? (logand (-> *target* state-flags) #x8008)) + (= *master-mode* 'game) + ) + ) (set! (-> *game-info* display-text-handle) (process->handle arg0)) (set! (-> *game-info* display-text-time) (-> *display* base-frame-counter)) #t @@ -247,10 +245,9 @@ (let ((a0-0 (ppointer->process *hint-semaphore*))) (the-as symbol - (and (the-as level-hint a0-0) (and - (= (-> (the-as level-hint a0-0) next-state name) 'level-hint-normal) - (not (dummy-15 (the-as level-hint a0-0))) - ) + (and (the-as level-hint a0-0) (and (= (-> (the-as level-hint a0-0) next-state name) 'level-hint-normal) + (not (dummy-15 (the-as level-hint a0-0))) + ) ) ) ) @@ -288,18 +285,17 @@ (kill-current-level-hint '() '() 'exit) ) ) - (the-as object (and - (not *hint-semaphore*) - (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) - (when s2-0 - (let ((t9-2 (method-of-type level-hint activate))) - (t9-2 (the-as level-hint s2-0) arg2 'level-hint (the-as pointer #x70004000)) - ) - (run-now-in-process s2-0 ambient-hint-init-by-other arg0 arg1 arg3) - (-> s2-0 ppointer) - ) - ) - ) + (the-as object (and (not *hint-semaphore*) + (let ((s2-0 (get-process *default-dead-pool* level-hint #x4000))) + (when s2-0 + (let ((t9-2 (method-of-type level-hint activate))) + (t9-2 (the-as level-hint s2-0) arg2 'level-hint (the-as pointer #x70004000)) + ) + (run-now-in-process s2-0 ambient-hint-init-by-other arg0 arg1 arg3) + (-> s2-0 ppointer) + ) + ) + ) ) ) @@ -308,10 +304,9 @@ (defun kill-current-level-hint ((arg0 pair) (arg1 pair) (arg2 symbol)) (when *hint-semaphore* (let ((s4-0 (ppointer->process *hint-semaphore*))) - (if (and - (or (null? arg0) (member (-> (the-as level-hint s4-0) mode) arg0)) - (not (member (-> (the-as level-hint s4-0) mode) arg1)) - ) + (if (and (or (null? arg0) (member (-> (the-as level-hint s4-0) mode) arg0)) + (not (member (-> (the-as level-hint s4-0) mode) arg1)) + ) (send-event (the-as level-hint s4-0) arg2) ) ) @@ -346,8 +341,7 @@ ) ) (if (and (not s5-1) a0-6) - (set! s5-1 (if (or - (and (= (-> a0-6 data 0) 115) (= (-> a0-6 data 1) 97)) + (set! s5-1 (if (or (and (= (-> a0-6 data 0) 115) (= (-> a0-6 data 1) 97)) (and (= (-> a0-6 data 0) 97) (= (-> a0-6 data 1) 115)) ) 'voicebox @@ -461,14 +455,13 @@ (hide-bottom-hud) (suspend) (cond - ((and - (bottom-hud-hidden?) - (not (paused?)) - (not (movie?)) - (= *master-mode* 'game) - (or (not *target*) (!= (-> *target* cam-user-mode) 'look-around)) - (not (-> *hud-parts* money-all)) - ) + ((and (bottom-hud-hidden?) + (not (paused?)) + (not (movie?)) + (= *master-mode* 'game) + (or (not *target*) (!= (-> *target* cam-user-mode) 'look-around)) + (not (-> *hud-parts* money-all)) + ) (print-text self) (+! (-> self total-time) (- (-> *display* base-frame-counter) (-> self last-time))) (set! (-> self last-time) (-> *display* base-frame-counter)) diff --git a/test/decompiler/reference/engine/ambient/mood_REF.gc b/test/decompiler/reference/engine/ambient/mood_REF.gc index b718b80ad5..ce235daee8 100644 --- a/test/decompiler/reference/engine/ambient/mood_REF.gc +++ b/test/decompiler/reference/engine/ambient/mood_REF.gc @@ -233,11 +233,10 @@ (set! (-> *time-of-day-context* light-interp arg2) f30-0) ) ) - (if (and - (= (-> arg0 current-prt-color x) 0.0) - (= (-> arg0 current-prt-color y) 0.0) - (= (-> arg0 current-prt-color z) 0.0) - ) + (if (and (= (-> arg0 current-prt-color x) 0.0) + (= (-> arg0 current-prt-color y) 0.0) + (= (-> arg0 current-prt-color z) 0.0) + ) (update-mood-prt-color arg0) ) f30-0 @@ -353,11 +352,10 @@ (set! (-> *time-of-day-context* light-masks-0 arg4) (the-as uint (ash 1 arg3))) (set! (-> *time-of-day-context* light-masks-1 arg4) (the-as uint 0)) (set! (-> *time-of-day-context* light-interp arg4) 0.0) - (if (and - (= (-> arg0 current-prt-color x) 0.0) - (= (-> arg0 current-prt-color y) 0.0) - (= (-> arg0 current-prt-color z) 0.0) - ) + (if (and (= (-> arg0 current-prt-color x) 0.0) + (= (-> arg0 current-prt-color y) 0.0) + (= (-> arg0 current-prt-color z) 0.0) + ) (update-mood-prt-color arg0) ) ) diff --git a/test/decompiler/reference/engine/anim/joint_REF.gc b/test/decompiler/reference/engine/anim/joint_REF.gc index 7dbf3d7574..b007290de8 100644 --- a/test/decompiler/reference/engine/anim/joint_REF.gc +++ b/test/decompiler/reference/engine/anim/joint_REF.gc @@ -228,10 +228,10 @@ "(none)" ) (+ (* (-> obj channel s4-0 frame-num) (if v1-6 - (-> v1-6 artist-step) - 1.0 - ) - ) + (-> v1-6 artist-step) + 1.0 + ) + ) (if v1-6 (-> v1-6 artist-base) 0.0 @@ -386,11 +386,10 @@ ;; definition for method 12 of type art-group ;; INFO: Return type mismatch object vs symbol. (defmethod needs-link? art-group ((obj art-group)) - (the-as symbol (and - (-> obj length) - (type-type? (-> obj data 0 type) art-joint-anim) - (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) - ) + (the-as symbol (and (-> obj length) + (type-type? (-> obj data 0 type) art-joint-anim) + (!= (-> obj name) (-> (the-as art-joint-anim (-> obj data 0)) master-art-group-name)) + ) ) ) @@ -403,11 +402,10 @@ (arg1 (let ((s3-0 (+ (length (-> obj name)) 1))) (dotimes (s2-0 (-> obj length)) - (if (and - (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) - ) + (if (and (-> obj data s2-0) + (= (-> obj data s2-0 type) arg1) + (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + ) (return (the-as joint (-> obj data s2-0))) ) ) @@ -432,11 +430,10 @@ (arg1 (let ((s3-0 (+ (length (-> obj name)) 1))) (dotimes (s2-0 (-> obj length)) - (if (and - (-> obj data s2-0) - (= (-> obj data s2-0 type) arg1) - (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) - ) + (if (and (-> obj data s2-0) + (= (-> obj data s2-0 type) arg1) + (or (name= arg0 (-> obj data s2-0 name)) (string-charp= arg0 (&-> (-> obj data s2-0 name) data s3-0))) + ) (return s2-0) ) ) diff --git a/test/decompiler/reference/engine/camera/cam-combiner_REF.gc b/test/decompiler/reference/engine/camera/cam-combiner_REF.gc index fb7845bd8a..c488146a19 100644 --- a/test/decompiler/reference/engine/camera/cam-combiner_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-combiner_REF.gc @@ -322,10 +322,9 @@ (vector-! (-> s1-0 vector 1) s0-0 s2-0) (vector-flatten! (the-as vector (-> s1-0 vector)) (the-as vector (-> s1-0 vector)) (-> *camera* local-down)) (vector-flatten! (-> s1-0 vector 1) (-> s1-0 vector 1) (-> *camera* local-down)) - (when (and - (< 4096.0 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0)) - (< 4096.0 (vector-normalize-ret-len! (-> s1-0 vector 1) 1.0)) - ) + (when (and (< 4096.0 (vector-normalize-ret-len! (the-as vector (-> s1-0 vector)) 1.0)) + (< 4096.0 (vector-normalize-ret-len! (-> s1-0 vector 1) 1.0)) + ) (vector-cross! (-> s1-0 vector 2) (-> s1-0 vector 1) (the-as vector (-> s1-0 vector))) (when (< (vector-dot (-> s1-0 vector 2) s4-1) -0.01) ) diff --git a/test/decompiler/reference/engine/camera/cam-layout_REF.gc b/test/decompiler/reference/engine/camera/cam-layout_REF.gc index 4e40883036..d270f0e876 100644 --- a/test/decompiler/reference/engine/camera/cam-layout_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-layout_REF.gc @@ -478,11 +478,10 @@ (defbehavior cam-layout-entity-volume-info cam-layout () (dotimes (gp-0 (-> self num-volumes)) (cond - ((and - (= gp-0 (-> self cur-volume)) - (= *camera-layout-blink* 'volume) - (zero? (logand (-> *display* real-actual-frame-counter) 8)) - ) + ((and (= gp-0 (-> self cur-volume)) + (= *camera-layout-blink* 'volume) + (zero? (logand (-> *display* real-actual-frame-counter) 8)) + ) ) (else (let ((s5-0 (-> *volume-descriptor* pos-vol gp-0))) @@ -670,10 +669,9 @@ (let ((s5-0 (new-stack-matrix0)) (s4-0 (new-stack-vector0)) ) - (when (and - (cam-slave-get-vector-with-offset arg0 s4-0 'trans) - (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (when (and (cam-slave-get-vector-with-offset arg0 s4-0 'trans) + (or (!= *camera-layout-blink* 'camera) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (cam-slave-get-rot arg0 s5-0) (camera-fov-frame s5-0 @@ -686,10 +684,9 @@ ) ) (let ((s5-1 (new-stack-vector0))) - (if (and - (cam-slave-get-vector-with-offset arg0 s5-1 'pivot) - (or (!= *camera-layout-blink* 'pivot) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (if (and (cam-slave-get-vector-with-offset arg0 s5-1 'pivot) + (or (!= *camera-layout-blink* 'pivot) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -700,10 +697,9 @@ ) ) (let ((s5-2 (new-stack-vector0))) - (if (and - (cam-slave-get-vector-with-offset arg0 s5-2 'align) - (or (!= *camera-layout-blink* 'align) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (if (and (cam-slave-get-vector-with-offset arg0 s5-2 'align) + (or (!= *camera-layout-blink* 'align) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -714,10 +710,9 @@ ) ) (let ((s5-3 (new-stack-vector0))) - (if (and - (cam-slave-get-vector-with-offset arg0 s5-3 'interesting) - (or (!= *camera-layout-blink* 'interesting) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (if (and (cam-slave-get-vector-with-offset arg0 s5-3 'interesting) + (or (!= *camera-layout-blink* 'interesting) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (camera-cross (new 'static 'vector :y 1024.0) (new 'static 'vector :z 1024.0) @@ -732,10 +727,9 @@ (s5-4 (new-stack-vector0)) (s4-1 (new-stack-vector0)) ) - (when (and - (get-curve-data! arg0 s3-1 'campath 'campath-k (the-as float -1000000000.0)) - (or (!= *camera-layout-blink* 'spline) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (when (and (get-curve-data! arg0 s3-1 'campath 'campath-k (the-as float -1000000000.0)) + (or (!= *camera-layout-blink* 'spline) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (cond ((cam-slave-get-vector-with-offset arg0 s4-1 'pivot) (curve-get-pos! s5-4 (-> (new 'static 'array float 1 0.0) 0) s3-1) @@ -744,17 +738,17 @@ (else (set! (-> s4-1 quad) (-> (the-as - vector - ((method-of-type res-lump get-property-struct) - arg0 - 'spline-offset - 'interp - (the-as float -1000000000.0) - s4-1 - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + vector + ((method-of-type res-lump get-property-struct) + arg0 + 'spline-offset + 'interp + (the-as float -1000000000.0) + s4-1 + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) quad ) ) @@ -785,10 +779,9 @@ (s4-2 (new-stack-vector0)) (s1-2 (new 'stack 'curve)) ) - (when (and - (get-curve-data! arg0 s3-2 'intro 'intro-k (the-as float -1000000000.0)) - (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-actual-frame-counter) 8)) - ) + (when (and (get-curve-data! arg0 s3-2 'intro 'intro-k (the-as float -1000000000.0)) + (or (!= *camera-layout-blink* 'intro) (logtest? (-> *display* real-actual-frame-counter) 8)) + ) (cond ((cam-slave-get-vector-with-offset arg0 s4-2 'pivot) (curve-get-pos! s5-5 (-> (new 'static 'array float 1 1.0) 0) s3-2) @@ -887,11 +880,10 @@ (let ((s5-8 (new 'stack 'interp-test-info)) (s4-5 (new-stack-vector0)) ) - (when (and - (cam-slave-get-vector-with-offset arg0 (-> s5-8 origin) 'pivot) - (cam-slave-get-vector-with-offset arg0 (-> s5-8 to) 'align) - (cam-slave-get-vector-with-offset arg0 (-> s5-8 from) 'trans) - ) + (when (and (cam-slave-get-vector-with-offset arg0 (-> s5-8 origin) 'pivot) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 to) 'align) + (cam-slave-get-vector-with-offset arg0 (-> s5-8 from) 'trans) + ) (camera-line (-> s5-8 from) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) (camera-line (-> s5-8 to) (-> s5-8 origin) (new 'static 'vector4w :x #x80 :y #x80 :z #x80 :w #x80)) (vector-! (-> s5-8 from) (-> s5-8 from) (-> s5-8 origin)) @@ -1967,10 +1959,9 @@ (defun cam-layout-save-splineoffset ((arg0 symbol) (arg1 string) (arg2 entity-actor)) (the-as string - (when (and - (not (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0))) - (res-lump-struct arg2 'spline-offset structure :time (the-as float -1000000000.0)) - ) + (when (and (not (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0))) + (res-lump-struct arg2 'spline-offset structure :time (the-as float -1000000000.0)) + ) (let ((s4-1 (res-lump-struct arg2 'spline-offset vector :time (the-as float -1000000000.0)))) (when s4-1 (if arg0 @@ -1992,18 +1983,17 @@ ;; definition for function cam-layout-save-spline-follow-dist-offset ;; INFO: Return type mismatch object vs string. (defun cam-layout-save-spline-follow-dist-offset ((arg0 symbol) (arg1 string) (arg2 entity-actor)) - (the-as string (when (and - (not (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0))) - ((method-of-type res-lump get-property-value-float) - arg2 - 'spline-follow-dist-offset - 'interp - (the-as float -1000000000.0) - (the-as float #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (the-as string (when (and (not (res-lump-struct arg2 'pivot structure :time (the-as float -1000000000.0))) + ((method-of-type res-lump get-property-value-float) + arg2 + 'spline-follow-dist-offset + 'interp + (the-as float -1000000000.0) + (the-as float #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) (let ((f30-0 ((method-of-type res-lump get-property-value-float) arg2 'spline-follow-dist-offset @@ -2625,51 +2615,48 @@ ) (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-off) (cond - ((logtest? - (s3-0 - s2-0 - (string->symbol *res-key-string*) - 'exact - f30-0 - (the-as uint128 0) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - s5-0 - ) + ((logtest? (s3-0 + s2-0 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) (format arg0 ": off") ) ((let ((s3-1 (method-of-type res-lump get-property-value)) (s2-1 (-> self cam-entity)) ) (format (clear *res-key-string*) "~S~S" (the-as object arg2) '-on) - (logtest? - (s3-1 - s2-1 - (string->symbol *res-key-string*) - 'exact - f30-0 - (the-as uint128 0) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - s5-0 - ) + (logtest? (s3-1 + s2-1 + (string->symbol *res-key-string*) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) ) (format arg0 ": on") ) - ((zero? (logand - ((method-of-type res-lump get-property-value) - (-> self cam-entity) - (the-as symbol arg2) - 'exact - f30-0 - (the-as uint128 0) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - s5-0 - ) + ((zero? (logand ((method-of-type res-lump get-property-value) + (-> self cam-entity) + (the-as symbol arg2) + 'exact + f30-0 + (the-as uint128 0) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + s5-0 + ) ) (format arg0 ": off(maya)") ) @@ -3851,17 +3838,15 @@ ((and (logtest? (-> arg0 options) 8) (logtest? (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) #f ) - ((and - (zero? (logand (-> arg0 options) 12)) - (logtest? (-> arg0 options) 1) - (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) - ) + ((and (zero? (logand (-> arg0 options) 12)) + (logtest? (-> arg0 options) 1) + (zero? (logand (-> *cpad-list* cpads 0 button0-rel 0) (-> arg0 button))) + ) #f ) - ((and - (zero? (logand (-> arg0 options) 13)) - (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) - ) + ((and (zero? (logand (-> arg0 options) 13)) + (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (-> arg0 button))) + ) #f ) ((type-type? (-> (the-as basic s5-0) type) clm) @@ -3999,8 +3984,8 @@ ) (dotimes (s2-2 (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions length)) (if (cam-layout-do-action - (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions s2-2) - ) + (-> (the-as clm-list s4-3) items (-> (the-as clm-list s4-3) cur-list-item) actions s2-2) + ) (goto cfg-65) ) ) diff --git a/test/decompiler/reference/engine/camera/cam-master_REF.gc b/test/decompiler/reference/engine/camera/cam-master_REF.gc index b0a7c9cb05..020a74268e 100644 --- a/test/decompiler/reference/engine/camera/cam-master_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-master_REF.gc @@ -74,10 +74,9 @@ (set! (-> self foot-offset) (-> *CAMERA_MASTER-bank* onscreen-foot-height)) (set! (-> self head-offset) (-> *CAMERA_MASTER-bank* onscreen-head-height)) (set! (-> self target-height) (-> *CAMERA_MASTER-bank* target-height)) - (set! (-> self on-ground) (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) ) ) (set! (-> self on-pole) #f) @@ -87,10 +86,10 @@ (set! (-> self string-push-z) (fmax (-> self string-min value z) (-> *CAMERA-bank* default-string-push-z))) (cond ((>= (- (-> *display* base-frame-counter) (if *target* - (-> *target* neck notice-time) - 0 - ) - ) + (-> *target* neck notice-time) + 0 + ) + ) (the-as int (-> *CAMERA-bank* attack-timeout)) ) (set! (-> self being-attacked) #f) @@ -98,10 +97,9 @@ (else (set! (-> self attack-start) (the-as uint (-> *display* base-frame-counter))) (set! (-> self being-attacked) #t) - (when (and - (zero? (logand (-> self master-options) 64)) - (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) - ) + (when (and (zero? (logand (-> self master-options) 64)) + (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + ) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) @@ -220,11 +218,10 @@ ;; Used lq/sq (defbehavior master-track-target camera-master () (cond - ((and - (logtest? (-> self master-options) 2) - (!= (-> self drawable-target) #f) - (not (handle->process (-> self drawable-target))) - ) + ((and (logtest? (-> self master-options) 2) + (!= (-> self drawable-target) #f) + (not (handle->process (-> self drawable-target))) + ) (set! (-> self master-options) (logand -3 (-> self master-options))) (set! (-> self drawable-target) (the-as handle #f)) ) @@ -317,10 +314,10 @@ ) (cond ((>= (- (-> *display* base-frame-counter) (if *target* - (-> *target* neck notice-time) - 0 - ) - ) + (-> *target* neck notice-time) + 0 + ) + ) (the-as int (-> *CAMERA-bank* attack-timeout)) ) (set! (-> self being-attacked) #f) @@ -330,10 +327,9 @@ (set! (-> self attack-start) (the-as uint (-> *display* base-frame-counter))) ) (set! (-> self being-attacked) #t) - (when (and - (zero? (logand (-> self master-options) 64)) - (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) - ) + (when (and (zero? (logand (-> self master-options) 64)) + (or (!= (-> last-try-to-look-at-data horz) 0.0) (!= (-> last-try-to-look-at-data vert) 0.0)) + ) (set! (-> self string-max target y) (fmax (-> self string-max target y) (-> last-try-to-look-at-data vert))) (set! (-> self string-max target z) (fmax (-> self string-max target z) (-> last-try-to-look-at-data horz))) (set! (-> self string-push-z) (fmax (-> self string-push-z) (-> self string-max target z))) @@ -398,22 +394,19 @@ ) ) ) - (set! (-> self on-ground) (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (set! (-> self on-ground) (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) ) ) (let ((gp-6 (new-stack-vector0))) 0.0 (cond - ((and - (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - (!= (-> *target* control unknown-surface00 name) 'launch-jump) - ) + ((and (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + (!= (-> *target* control unknown-surface00 name) 'launch-jump) + ) (if *display-cam-los-debug* (format *stdcon* "air tracking~%") ) @@ -553,9 +546,9 @@ (else (dotimes (a0-2 (the-as int (-> sv-16 elt-count))) (if (< arg2 (- (vector-dot arg0 (-> (the-as (inline-array vector) v1-1) a0-2)) - (-> (the-as (inline-array vector) v1-1) a0-2 w) - ) - ) + (-> (the-as (inline-array vector) v1-1) a0-2 w) + ) + ) (goto cfg-12) ) ) @@ -806,43 +799,39 @@ ((or (not *target*) (logtest? (-> self master-options) 1)) (master-unset-region) ) - ((and - (logtest? (-> self master-options) 4) - (not (-> self on-ground)) - (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) - ) + ((and (logtest? (-> self master-options) 4) + (not (-> self on-ground)) + (or (not (-> self cam-entity)) (zero? (logand #x20000 (cam-slave-get-flags (-> self cam-entity) 'flags)))) + ) #f ) - ((and - (-> self cam-entity) - (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) - (or - (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) - (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) - (and - (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'pvol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - (not ((method-of-type res-lump get-property-data) - (-> self cam-entity) - 'vol - 'exact - 0.0 - (the-as pointer #f) - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) - ) - ) - ) + ((and (-> self cam-entity) + (not (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 0.0 'cutoutvol)) + (or (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'pvol) + (in-cam-entity-volume? (target-pos 0) (-> self cam-entity) 1024.0 'vol) + (and (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'pvol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + (not ((method-of-type res-lump get-property-data) + (-> self cam-entity) + 'vol + 'exact + 0.0 + (the-as pointer #f) + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) + ) + ) + ) #f ) (else @@ -851,10 +840,9 @@ (let ((gp-5 (-> v1-17 next0))) (while (!= v1-17 (-> *camera-engine* alive-list-end)) (let ((s5-1 (-> (the-as connection v1-17) param1))) - (when (and - (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) - (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) - ) + (when (and (not (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 1024.0 'cutoutvol)) + (in-cam-entity-volume? (target-pos 0) (the-as entity s5-1) 0.0 'vol) + ) (if (master-switch-to-entity (the-as entity s5-1)) (return #t) ) diff --git a/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc b/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc index 4f7935d2dd..12e7e367b8 100644 --- a/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states-dbg_REF.gc @@ -244,12 +244,11 @@ (else (when *camera-read-buttons* (if (logtest? (-> *cpad-list* cpads arg3 button0-abs 0) (pad-buttons r1)) - (+! - (-> arg1 y) - (+ (-> *CAM_FREE-bank* speed) - (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 9)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) - ) - ) + (+! (-> arg1 y) + (+ (-> *CAM_FREE-bank* speed) + (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 9)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) + ) + ) ) ) (when *camera-read-buttons* @@ -268,12 +267,11 @@ (when (and (!= *master-mode* 'menu) (not *cam-layout*)) (when *camera-read-buttons* (if (logtest? (-> *cpad-list* cpads arg3 button0-abs 0) (pad-buttons left)) - (+! - (-> arg1 x) - (+ (-> *CAM_FREE-bank* speed) - (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 1)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) - ) - ) + (+! (-> arg1 x) + (+ (-> *CAM_FREE-bank* speed) + (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 1)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) + ) + ) ) ) (when *camera-read-buttons* @@ -289,12 +287,11 @@ ) (when *camera-read-buttons* (if (logtest? (-> *cpad-list* cpads arg3 button0-abs 0) (pad-buttons up)) - (+! - (-> arg1 z) - (+ (-> *CAM_FREE-bank* speed) - (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 2)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) - ) - ) + (+! (-> arg1 z) + (+ (-> *CAM_FREE-bank* speed) + (analog-input (the-as int (-> *cpad-list* cpads arg3 abutton 2)) 0.0 32.0 230.0 (-> *CAM_FREE-bank* speed)) + ) + ) ) ) (when *camera-read-buttons* @@ -316,12 +313,11 @@ (f26-0 (analog-input (the-as int (-> *cpad-list* cpads arg3 righty)) 128.0 48.0 110.0 -1.0)) ) (when *display-load-boundaries* - (when (and - (!= arg3 1) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons x))) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r1))) - (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2))) - ) + (when (and (!= arg3 1) + (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons x))) + (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r1))) + (zero? (logand (-> *cpad-list* cpads 1 button0-abs 0) (pad-buttons r2))) + ) (+! f28-14 (analog-input (the-as int (-> *cpad-list* cpads 1 leftx)) 128.0 48.0 110.0 -1.0)) (+! f30-14 (analog-input (the-as int (-> *cpad-list* cpads 1 lefty)) 128.0 48.0 110.0 -1.0)) (+! f24-0 (analog-input (the-as int (-> *cpad-list* cpads 1 rightx)) 128.0 48.0 110.0 -1.0)) @@ -559,7 +555,10 @@ (none) ) :exit - (behavior () '() (none)) + (behavior () + '() + (none) + ) :code (behavior () (while #t diff --git a/test/decompiler/reference/engine/camera/cam-states_REF.gc b/test/decompiler/reference/engine/camera/cam-states_REF.gc index e91c0b7806..dd9ce71920 100644 --- a/test/decompiler/reference/engine/camera/cam-states_REF.gc +++ b/test/decompiler/reference/engine/camera/cam-states_REF.gc @@ -655,7 +655,10 @@ (none) ) :exit - (behavior () '() (none)) + (behavior () + '() + (none) + ) :trans (behavior () (if (zero? (logand (-> *camera* master-options) 2)) @@ -787,8 +790,8 @@ (curve-get-pos! s5-1 (the-as float 0.0) (-> self spline-curve)) (curve-get-pos! gp-1 (the-as float 1.0) (-> self spline-curve)) (if (< (vector-vector-distance-squared s5-1 (-> self tracking follow-pt)) - (vector-vector-distance-squared gp-1 (-> self tracking follow-pt)) - ) + (vector-vector-distance-squared gp-1 (-> self tracking follow-pt)) + ) (set! (-> self spline-follow-dist) (- (-> self spline-follow-dist))) ) ) @@ -885,10 +888,9 @@ (curve-get-pos! gp-0 (parameter-ease-sin-clamp (-> *camera* outro-t)) (-> *camera* outro-curve)) (vector-! gp-0 gp-0 s5-0) (cond - ((or - (and (< (-> *camera* outro-t-step) 0.0) (>= (-> *camera* outro-exit-value) (-> *camera* outro-t))) - (and (< 0.0 (-> *camera* outro-t-step)) (>= (-> *camera* outro-t) (-> *camera* outro-exit-value))) - ) + ((or (and (< (-> *camera* outro-t-step) 0.0) (>= (-> *camera* outro-exit-value) (-> *camera* outro-t))) + (and (< 0.0 (-> *camera* outro-t-step)) (>= (-> *camera* outro-t) (-> *camera* outro-exit-value))) + ) (set! (-> *camera* outro-t) (-> *camera* outro-exit-value)) (set! (-> *camera* outro-t-step) 0.0) (vector+! (-> self velocity) (-> self velocity) gp-0) @@ -1054,13 +1056,11 @@ ) (vector-matrix*! arg0 arg1 s3-0) ) - ((and - (logtest? (-> self options) 2) - (or - (and (>= f26-0 (+ -8192.0 f30-0)) (>= f30-0 (+ -8192.0 (-> self pivot-rad)))) - (and (>= (+ 8192.0 f30-0) f26-0) (>= (+ 8192.0 (-> self pivot-rad)) f30-0)) - ) - ) + ((and (logtest? (-> self options) 2) + (or (and (>= f26-0 (+ -8192.0 f30-0)) (>= f30-0 (+ -8192.0 (-> self pivot-rad)))) + (and (>= (+ 8192.0 f30-0) f26-0) (>= (+ 8192.0 (-> self pivot-rad)) f30-0)) + ) + ) (let ((s2-1 (new 'stack-no-clear 'vector))) (vector-cross! s2-1 arg1 arg0) (vector-normalize! s2-1 (the-as float 1.0)) @@ -1203,10 +1203,9 @@ ) (set! (-> self fov1) (cam-slave-get-float (-> self cam-entity) 'focalPull (the-as float 0.0))) (cond - ((and - (!= (-> self fov1) 0.0) - (dummy-9 (-> self fov-index) 'focalpull (-> self cam-entity) (-> self saved-pt) (the-as curve #f)) - ) + ((and (!= (-> self fov1) 0.0) + (dummy-9 (-> self fov-index) 'focalpull (-> self cam-entity) (-> self saved-pt) (the-as curve #f)) + ) (set! (-> self fov0) (-> self fov)) (set! (-> self fov) (lerp-clamp (-> self fov0) (-> self fov1) (dummy-10 (-> self fov-index) (-> *camera* tpos-curr-adj))) @@ -1338,17 +1337,17 @@ (while #t (vector--float*! s4-0 arg0 (-> *camera* local-down) (-> *camera* target-height)) (if (< (dummy-10 - *collide-cache* - (-> *camera* tpos-curr-adj) - arg0 - (the-as float 409.6) - #x4a09 - (the-as process #f) - s3-0 - 2 - ) - 0.0 + *collide-cache* + (-> *camera* tpos-curr-adj) + arg0 + (the-as float 409.6) + #x4a09 + (the-as process #f) + s3-0 + 2 ) + 0.0 + ) (return #t) ) (set! f30-0 (cond @@ -1781,26 +1780,20 @@ ) (vector-normalize! arg1 (- f30-0 (-> *CAM_STRING-bank* los-coll-rad))) ) - ((and - (or - (< 0.01 (-> arg0 vert-1 y)) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - (< 0.01 (the-as float (-> arg0 gap-poly))) - ) - ) - (or - (< (-> arg0 vert-1 x) -0.01) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - (< (the-as float (-> arg0 poly)) -0.01) - ) - ) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (or (< (-> arg0 boundary-normal y) 0.01) (< -0.01 (-> arg0 boundary-normal x))) - ) - ) + ((and (or (< 0.01 (-> arg0 vert-1 y)) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + (< 0.01 (the-as float (-> arg0 gap-poly))) + ) + ) + (or (< (-> arg0 vert-1 x) -0.01) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + (< (the-as float (-> arg0 poly)) -0.01) + ) + ) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (or (< (-> arg0 boundary-normal y) 0.01) (< -0.01 (-> arg0 boundary-normal x))) + ) + ) (when (not (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal)))) ) (if (not (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection)))) @@ -1812,26 +1805,20 @@ (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (+ f28-0 (-> *CAM_STRING-bank* los-coll-rad))) ) - ((and - (or - (< 0.01 (-> arg0 vert-1 w)) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (< 0.01 (-> arg0 boundary-normal y)) - ) - ) - (or - (< (-> arg0 vert-1 z) -0.01) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (< (-> arg0 boundary-normal x) -0.01) - ) - ) - (and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - (or (< (the-as float (-> arg0 gap-poly)) 0.01) (< -0.01 (the-as float (-> arg0 poly)))) - ) - ) + ((and (or (< 0.01 (-> arg0 vert-1 w)) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (< 0.01 (-> arg0 boundary-normal y)) + ) + ) + (or (< (-> arg0 vert-1 z) -0.01) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (< (-> arg0 boundary-normal x) -0.01) + ) + ) + (and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + (or (< (the-as float (-> arg0 gap-poly)) 0.01) (< -0.01 (the-as float (-> arg0 poly)))) + ) + ) (if (not (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal)))) (format #t "s diag cw invalid ccw~%") ) @@ -1860,36 +1847,33 @@ ) ) ) - ((and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - (< 0.01 (the-as float (-> arg0 gap-poly))) - (< (the-as float (-> arg0 poly)) -0.01) - (or (< (-> arg0 boundary-normal y) 0.01) (< -0.01 (-> arg0 boundary-normal x))) - ) + ((and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + (< 0.01 (the-as float (-> arg0 gap-poly))) + (< (the-as float (-> arg0 poly)) -0.01) + (or (< (-> arg0 boundary-normal y) 0.01) (< -0.01 (-> arg0 boundary-normal x))) + ) (if *display-cam-los-debug* (format *stdcon* "diagonal ccw~%") ) (set! (-> self los-state) (slave-los-state ccw)) (vector-normalize! arg1 (- (-> *CAM_STRING-bank* los-coll-rad) (-> arg0 next-normal z))) ) - ((and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - (< 0.01 (-> arg0 boundary-normal y)) - (< (-> arg0 boundary-normal x) -0.01) - (or (< (the-as float (-> arg0 gap-poly)) 0.01) (< -0.01 (the-as float (-> arg0 poly)))) - ) + ((and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + (< 0.01 (-> arg0 boundary-normal y)) + (< (-> arg0 boundary-normal x) -0.01) + (or (< (the-as float (-> arg0 gap-poly)) 0.01) (< -0.01 (the-as float (-> arg0 poly)))) + ) (if *display-cam-los-debug* (format *stdcon* "diagonal cw~%") ) (set! (-> self los-state) (slave-los-state cw)) (vector-normalize! arg1 (- (-> arg0 intersection z) (-> *CAM_STRING-bank* los-coll-rad))) ) - ((and - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) - (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) - ) + ((and (dist-info-valid? (the-as collide-los-dist-info (-> arg0 intersection))) + (dist-info-valid? (the-as collide-los-dist-info (-> arg0 next-normal))) + ) (set! (-> self los-state) (slave-los-state between)) (vector-normalize! arg1 (the-as float 0.0001)) ) @@ -2106,26 +2090,24 @@ ) (set! s2-2 (-> self los-tgt-spline-pt)) (set! s1-3 -134250495) - (while (and - (!= s2-2 -134250495) - (begin - (set! f30-1 - (cam-los-spline-collide - (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) - arg0 - (the-as vector 4098) - ) - ) - (< f30-1 0.0) - ) - ) + (while (and (!= s2-2 -134250495) + (begin + (set! f30-1 + (cam-los-spline-collide + (the-as vector (+ (the-as uint (-> *camera* target-spline)) (* 48 s2-2))) + arg0 + (the-as vector 4098) + ) + ) + (< f30-1 0.0) + ) + ) (set! s1-3 s2-2) (set! s2-2 (-> *camera* target-spline point s2-2 next)) ) - (and - (= s2-2 (-> *camera* target-spline used-point)) - (!= (-> *camera* target-spline point s2-2 next) -134250495) - ) + (and (= s2-2 (-> *camera* target-spline used-point)) + (!= (-> *camera* target-spline point s2-2 next) -134250495) + ) ) (when *display-cam-los-debug* (format 0 "looking at used point~%") @@ -2181,10 +2163,9 @@ (set! f28-1 0.4096) ) (let ((f30-2 (cond - ((and - (= (-> self string-vel-dir) 6) - (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) - ) + ((and (= (-> self string-vel-dir) 6) + (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) + ) (fmin 1.0 (+ 0.001 f30-1)) ) ((= (-> self string-vel-dir) 6) @@ -2204,11 +2185,10 @@ ) (vector-flatten! s2-3 s2-3 (-> *camera* local-down)) (cond - ((and - (< (fabs (- (-> self desired-pos y) (-> self trans y))) 8192.0) - (< f28-1 (+ 1024.0 (-> self string-min-val z))) - (< (vector-length s2-3) 8192.0) - ) + ((and (< (fabs (- (-> self desired-pos y) (-> self trans y))) 8192.0) + (< f28-1 (+ 1024.0 (-> self string-min-val z))) + (< (vector-length s2-3) 8192.0) + ) (set! f30-2 0.0) ) ((< f28-1 (+ 1024.0 (-> self string-min-val z))) @@ -2358,10 +2338,9 @@ ((< f28-0 f0-4) (vector-normalize! (-> self view-flat) f0-4) ) - ((and - (< f30-0 f28-0) - (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) - ) + ((and (< f30-0 f28-0) + (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + ) (vector-normalize! (-> self view-flat) f30-0) ) ((< f26-0 f28-0) @@ -2457,10 +2436,9 @@ (if (-> self have-phony-joystick) (set! f28-0 (* 0.05 (-> self phony-joystick-y))) ) - (if (and - (-> *camera* being-attacked) - (< (- (-> *display* base-frame-counter) (the-as int (-> *camera* attack-start))) 75) - ) + (if (and (-> *camera* being-attacked) + (< (- (-> *display* base-frame-counter) (the-as int (-> *camera* attack-start))) 75) + ) (set! f28-0 0.05) ) (if (!= f28-0 0.0) @@ -2500,10 +2478,9 @@ ) ((and (>= f28-0 0.0) (>= f0-16 1.0)) ) - ((and - (< 0.0 f28-0) - (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) - ) + ((and (< 0.0 f28-0) + (or (= (-> self los-state) (slave-los-state ccw)) (= (-> self los-state) (slave-los-state cw))) + ) ) ((< (* 0.05 (- 1.0 f0-16)) f28-0) (let ((f0-17 (+ f0-16 (* 0.05 (- 1.0 f0-16))))) @@ -2664,10 +2641,9 @@ (vector-normalize-copy! s4-1 (-> self view-flat) (the-as float 1.0)) (vector-cross! gp-1 s4-1 s5-1) (cond - ((and - (< (vector-length (-> self velocity)) (-> *CAMERA-bank* min-detectable-velocity)) - (< (vector-length s3-0) (-> *CAMERA-bank* min-detectable-velocity)) - ) + ((and (< (vector-length (-> self velocity)) (-> *CAMERA-bank* min-detectable-velocity)) + (< (vector-length s3-0) (-> *CAMERA-bank* min-detectable-velocity)) + ) (set! (-> self string-vel-dir) (the-as uint 0)) 0 ) @@ -2704,10 +2680,9 @@ (cam-collision-record-save (-> self string-trans) (-> self velocity) -1 'no-hit self) ) ) - (while (and - (< 0.01 f30-2) - (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (< gp-2 4)) - ) + (while (and (< 0.01 f30-2) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (< gp-2 4)) + ) (vector-float*! s5-2 (-> self velocity) f30-2) (if *debug-segment* (cam-collision-record-save (-> self string-trans) s5-2 gp-2 'normal self) @@ -3156,10 +3131,9 @@ (s2-0 0) ) (let ((s3-0 (new 'stack-no-clear 'collide-tri-result))) - (while (and - (< 0.01 f30-1) - (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s4-0 0)) - ) + (while (and (< 0.01 f30-1) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s4-0 0)) + ) (+! s4-0 -1) (vector-float*! gp-2 (-> self velocity) f30-1) (let ((f28-0 (if (logtest? (-> self options) 32) @@ -3441,10 +3415,9 @@ (s5-3 4) (s4-3 (new 'stack-no-clear 'collide-tri-result)) ) - (while (and - (< 0.01 f30-2) - (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s5-3 0)) - ) + (while (and (< 0.01 f30-2) + (and (< (-> *CAMERA-bank* min-detectable-velocity) (vector-length (-> self velocity))) (> s5-3 0)) + ) (+! s5-3 -1) (vector-float*! gp-3 (-> self velocity) f30-2) (let ((f28-0 diff --git a/test/decompiler/reference/engine/camera/camera_REF.gc b/test/decompiler/reference/engine/camera/camera_REF.gc index 2ea916a6d3..466958ba89 100644 --- a/test/decompiler/reference/engine/camera/camera_REF.gc +++ b/test/decompiler/reference/engine/camera/camera_REF.gc @@ -566,8 +566,7 @@ (set! (-> s5-0 partial-pt) (-> obj partial-point)) (TODO-RENAME-19 obj (-> obj sample-len) (the-as vector a2-0) s5-0) ) - (if (or - (= (-> s5-0 cur-pt) (-> obj end-point)) + (if (or (= (-> s5-0 cur-pt) (-> obj end-point)) (= (-> s5-0 cur-pt) (-> obj next-to-last-point)) (= (-> obj point (-> s5-0 cur-pt) next) (-> obj next-to-last-point)) ) @@ -618,22 +617,21 @@ (let ((s4-1 (-> obj point (-> s4-0 cur-pt) next))) (when (!= s4-1 -134250495) (let ((v1-11 (-> obj point s4-1 next))) - (while (not (or - (= v1-11 -134250495) - (= (-> obj point v1-11 next) -134250495) - (= (-> obj point v1-11 next) (-> obj end-point)) - (= (-> obj point v1-11 next) (-> obj next-to-last-point)) - ) + (while (not (or (= v1-11 -134250495) + (= (-> obj point v1-11 next) -134250495) + (= (-> obj point v1-11 next) (-> obj end-point)) + (= (-> obj point v1-11 next) (-> obj next-to-last-point)) + ) ) (if (< (* (-> obj point s4-1 tp-length) - (+ 1.0 (vector-dot - (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) - (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 v1-11))) - ) - ) + (+ 1.0 (vector-dot + (the-as vector (+ (the-as uint (-> obj point 0 direction)) (* 48 s4-1))) + (the-as vector (+ (the-as uint (the-as vector (-> obj point 0 direction))) (* 48 v1-11))) + ) ) - arg0 - ) + ) + arg0 + ) (TODO-RENAME-13 obj s4-1) (set! s4-1 v1-11) ) diff --git a/test/decompiler/reference/engine/camera/math-camera_REF.gc b/test/decompiler/reference/engine/camera/math-camera_REF.gc index ba0a7fafe0..7288dfaff5 100644 --- a/test/decompiler/reference/engine/camera/math-camera_REF.gc +++ b/test/decompiler/reference/engine/camera/math-camera_REF.gc @@ -119,8 +119,8 @@ (let ((hvdf-x 2048.0) (hvdf-y 2048.0) (hvdf-w (/ (- (* (-> *math-camera-fog-correction* fog-end) (-> math-cam fog-max)) - (* (-> *math-camera-fog-correction* fog-start) (-> math-cam fog-min)) - ) + (* (-> *math-camera-fog-correction* fog-start) (-> math-cam fog-min)) + ) (- (-> *math-camera-fog-correction* fog-end) (-> *math-camera-fog-correction* fog-start)) ) ) diff --git a/test/decompiler/reference/engine/camera/pov-camera_REF.gc b/test/decompiler/reference/engine/camera/pov-camera_REF.gc index c9d86ae52e..83eddea166 100644 --- a/test/decompiler/reference/engine/camera/pov-camera_REF.gc +++ b/test/decompiler/reference/engine/camera/pov-camera_REF.gc @@ -3,13 +3,11 @@ ;; definition for method 25 of type pov-camera (defmethod TODO-RENAME-25 pov-camera ((obj pov-camera)) - (when (or - (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj debounce-start-time))) 60) - (cpad-pressed? 0 triangle) + (when (or (and (>= (- (-> *display* base-frame-counter) (the-as int (-> obj debounce-start-time))) 60) + (cpad-pressed? 0 triangle) + ) + (logtest? (-> obj flags) 2) ) - (logtest? (-> obj flags) 2) - ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (when (logtest? (-> obj flags) 1) @@ -33,7 +31,10 @@ (defstate pov-camera-startup (pov-camera) :virtual #t :code - (behavior () (go-virtual pov-camera-start-playing) (none)) + (behavior () + (go-virtual pov-camera-start-playing) + (none) + ) ) ;; failed to figure out what this is: @@ -82,15 +83,15 @@ ) (until (ja-done? 0) (let ((v1-4 (and (not s4-0) (< (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -4 - ) - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -4 + ) + ) (ja-frame-num 0) ) ) @@ -158,12 +159,12 @@ ) ) (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -214,9 +215,18 @@ (defstate pov-camera-abort (pov-camera) :virtual #t :enter - (behavior () (logior! (-> self flags) 2) (none)) + (behavior () + (logior! (-> self flags) 2) + (none) + ) :code - (behavior () (set-blackout-frames 10) (suspend) (suspend) (go-virtual pov-camera-done-playing) (none)) + (behavior () + (set-blackout-frames 10) + (suspend) + (suspend) + (go-virtual pov-camera-done-playing) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/engine/collide/collide-touch_REF.gc b/test/decompiler/reference/engine/collide/collide-touch_REF.gc index dcdfe2b6ea..c98035693a 100644 --- a/test/decompiler/reference/engine/collide/collide-touch_REF.gc +++ b/test/decompiler/reference/engine/collide/collide-touch_REF.gc @@ -101,8 +101,7 @@ (let ((t0-0 (-> (the-as touching-shapes-entry v0-0) cshape1))) (set! v1-0 (cond (t0-0 - (if (or - (and (= t0-0 arg0) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg1)) + (if (or (and (= t0-0 arg0) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg1)) (and (= t0-0 arg1) (= (-> (the-as touching-shapes-entry v0-0) cshape2) arg0)) ) (return (the-as touching-shapes-entry v0-0)) diff --git a/test/decompiler/reference/engine/data/res_REF.gc b/test/decompiler/reference/engine/data/res_REF.gc index e58ce3dfc1..60e9fcc467 100644 --- a/test/decompiler/reference/engine/data/res_REF.gc +++ b/test/decompiler/reference/engine/data/res_REF.gc @@ -121,15 +121,14 @@ ;; Used lq/sq (defmethod lookup-tag-idx res-lump ((obj res-lump) (name-sym symbol) (mode symbol) (time float)) (local-vars (tag-idx int)) - (when (or - (= name-sym 'id) - (= name-sym 'aid) - (= name-sym 'trans) - (= name-sym 'rot) - (= name-sym 'nav-mesh) - (= name-sym 'process-type) - (= name-sym 'task) - ) + (when (or (= name-sym 'id) + (= name-sym 'aid) + (= name-sym 'trans) + (= name-sym 'rot) + (= name-sym 'nav-mesh) + (= name-sym 'process-type) + (= name-sym 'task) + ) (crash!) 0 ) @@ -169,10 +168,9 @@ (if (< tag-idx 0) (return (the-as res-tag-pair tag-idx)) ) - (while (and - (> tag-idx 0) - (= type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ tag-idx -1) name)) data)) 0)) - ) + (while (and (> tag-idx 0) + (= type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> obj tag (+ tag-idx -1) name)) data)) 0)) + ) (+! tag-idx -1) ) (when (= mode 'base) @@ -183,10 +181,9 @@ (let ((interp-tag-idx tag-idx) (tag-ptr (&-> (-> obj tag) tag-idx)) ) - (while (not (or - (>= interp-tag-idx (-> obj length)) - (< type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> tag-ptr 0 name)) data)) 0)) - ) + (while (not (or (>= interp-tag-idx (-> obj length)) + (< type-chars (-> (the-as (pointer uint64) (-> (symbol->string (-> tag-ptr 0 name)) data)) 0)) + ) ) (cond ((!= name-sym (-> tag-ptr 0 name)) @@ -236,12 +233,11 @@ ((zero? (-> tag-lo inlined?)) (&+ (-> obj data-base) (-> tag-lo data-offset)) ) - ((or - (not buf) - (= (-> result lo) (-> result hi)) - (!= elt-count (-> tag-hi elt-count)) - (!= (-> tag-lo elt-type) (-> tag-hi elt-type)) - ) + ((or (not buf) + (= (-> result lo) (-> result hi)) + (!= elt-count (-> tag-hi elt-count)) + (!= (-> tag-lo elt-type) (-> tag-hi elt-type)) + ) (let ((a0-4 tag-lo)) (&+ (-> obj data-base) (-> a0-4 data-offset)) ) diff --git a/test/decompiler/reference/engine/debug/anim-tester_REF.gc b/test/decompiler/reference/engine/debug/anim-tester_REF.gc index b3387a48bf..0a19cfdbf8 100644 --- a/test/decompiler/reference/engine/debug/anim-tester_REF.gc +++ b/test/decompiler/reference/engine/debug/anim-tester_REF.gc @@ -890,22 +890,20 @@ ) (let ((v1-18 (-> (the-as anim-test-sequence s5-0) item-list))) "is the list empty, #t = empty" - (if (or - (= (-> v1-18 tailpred) v1-18) - (and - (= (glst-num-elements (-> (the-as anim-test-sequence s5-0) item-list)) 1) - (begin - (let ((v1-21 #t) - (a0-13 (-> (the-as anim-test-sequence s5-0) item-list)) - ) - "return the start of the list" - (let ((a0-16 (the-as int (logand (-> (the-as anim-test-seq-item (-> a0-13 head)) flags) 1)))) - (cmove-#f-zero v1-19 a0-16 v1-21) - ) - ) - v1-19 - ) - ) + (if (or (= (-> v1-18 tailpred) v1-18) + (and (= (glst-num-elements (-> (the-as anim-test-sequence s5-0) item-list)) 1) + (begin + (let ((v1-21 #t) + (a0-13 (-> (the-as anim-test-sequence s5-0) item-list)) + ) + "return the start of the list" + (let ((a0-16 (the-as int (logand (-> (the-as anim-test-seq-item (-> a0-13 head)) flags) 1)))) + (cmove-#f-zero v1-19 a0-16 v1-21) + ) + ) + v1-19 + ) + ) ) (glst-remove (-> arg0 seq-list) (the-as anim-test-sequence s5-0)) ) @@ -1740,10 +1738,9 @@ ) (let ((gp-0 (-> arg1 the-node)) (s4-0 (the-as object (-> arg1 list-owner))) - (s2-0 (and - (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt3)) - (zero? (-> *anim-tester* 0 item-field)) - ) + (s2-0 (and (logtest? (-> *anim-tester* 0 flags) (anim-tester-flags fanimt3)) + (zero? (-> *anim-tester* 0 item-field)) + ) ) ) (cond @@ -2489,7 +2486,10 @@ :event anim-tester-standard-event-handler :enter - (behavior () (logior! (-> self flags) (anim-tester-flags fanimt1)) (none)) + (behavior () + (logior! (-> self flags) (anim-tester-flags fanimt1)) + (none) + ) :trans (behavior () (if (and (zero? (logand (-> self flags) (anim-tester-flags fanimt1))) (= *master-mode* 'menu)) @@ -2544,8 +2544,8 @@ ) ((begin (if (>= (-> (the-as anim-test-obj s4-0) list-con current-index) - (glst-num-elements (-> (the-as anim-test-obj s4-0) seq-list)) - ) + (glst-num-elements (-> (the-as anim-test-obj s4-0) seq-list)) + ) (set! (-> (the-as anim-test-obj s4-0) list-con current-index) (+ (glst-num-elements (-> (the-as anim-test-obj s4-0) seq-list)) -1) ) diff --git a/test/decompiler/reference/engine/debug/debug_REF.gc b/test/decompiler/reference/engine/debug/debug_REF.gc index 2eda3c998a..68d2ad74e7 100644 --- a/test/decompiler/reference/engine/debug/debug_REF.gc +++ b/test/decompiler/reference/engine/debug/debug_REF.gc @@ -192,10 +192,9 @@ ) (set! (-> arg1 w) 1.0) (set! (-> sv-80 w) 1.0) - (when (and - (transform-point-qword! (the-as vector4w (-> s4-0 quad)) arg1) - (transform-point-qword! (the-as vector4w (&-> s4-0 quad 1)) sv-80) - ) + (when (and (transform-point-qword! (the-as vector4w (-> s4-0 quad)) arg1) + (transform-point-qword! (the-as vector4w (&-> s4-0 quad 1)) sv-80) + ) (let* ((v1-28 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (a2-1 (-> v1-28 base)) ) @@ -396,11 +395,10 @@ (set! (-> arg2 w) 1.0) (set! (-> arg3 w) 1.0) (set! (-> arg4 w) 1.0) - (when (and - (transform-point-qword! (the-as vector4w (-> s5-0 quad)) arg2) - (transform-point-qword! (the-as vector4w (&-> s5-0 quad 1)) arg3) - (transform-point-qword! (the-as vector4w (&-> s5-0 quad 2)) arg4) - ) + (when (and (transform-point-qword! (the-as vector4w (-> s5-0 quad)) arg2) + (transform-point-qword! (the-as vector4w (&-> s5-0 quad 1)) arg3) + (transform-point-qword! (the-as vector4w (&-> s5-0 quad 2)) arg4) + ) (let* ((v1-9 (-> *display* frames (-> *display* on-screen) frame debug-buf)) (a2-1 (-> v1-9 base)) ) @@ -1298,16 +1296,13 @@ (new 'static 'rgba :r #xff :g #xff :b #xff :a #x80) ) (let ((s2-1 (vector+*! (new-stack-vector0) arg3 (-> arg2 direction) (* 12288.0 (-> arg2 levels x)))) - (s1-0 (logior - (logior - (logior - (shr (shl (the int (* 128.0 (-> arg2 color w))) 56) 32) - (shr (shl (the int (* 128.0 (-> arg2 color z))) 56) 40) - ) - (shr (shl (the int (* 128.0 (-> arg2 color y))) 56) 48) - ) - (shr (shl (the int (* 128.0 (-> arg2 color x))) 56) 56) - ) + (s1-0 (logior (logior (logior (shr (shl (the int (* 128.0 (-> arg2 color w))) 56) 32) + (shr (shl (the int (* 128.0 (-> arg2 color z))) 56) 40) + ) + (shr (shl (the int (* 128.0 (-> arg2 color y))) 56) 48) + ) + (shr (shl (the int (* 128.0 (-> arg2 color x))) 56) 56) + ) ) ) (format (clear *temp-string*) "~S ~,,2f" arg4 (-> arg2 levels x)) diff --git a/test/decompiler/reference/engine/debug/default-menu_REF.gc b/test/decompiler/reference/engine/debug/default-menu_REF.gc index d34a89b4ec..9260fc5852 100644 --- a/test/decompiler/reference/engine/debug/default-menu_REF.gc +++ b/test/decompiler/reference/engine/debug/default-menu_REF.gc @@ -533,13 +533,12 @@ ;; definition for function dm-shader-pick-func (defun dm-shader-pick-func ((arg0 texture-id) (arg1 debug-menu-msg)) - (if (and - (= arg1 (debug-menu-msg press)) - *texture-page-dir* - (-> *texture-page-dir* entries (-> arg0 page) page) - (-> *texture-page-dir* entries (-> arg0 page) link) - (nonzero? (-> *texture-page-dir* entries (-> arg0 page) link next (-> arg0 index))) - ) + (if (and (= arg1 (debug-menu-msg press)) + *texture-page-dir* + (-> *texture-page-dir* entries (-> arg0 page) page) + (-> *texture-page-dir* entries (-> arg0 page) link) + (nonzero? (-> *texture-page-dir* entries (-> arg0 page) link next (-> arg0 index))) + ) (set! *edit-shader* arg0) ) (and (nonzero? *edit-shader*) (= arg0 *edit-shader*)) diff --git a/test/decompiler/reference/engine/debug/viewer_REF.gc b/test/decompiler/reference/engine/debug/viewer_REF.gc index 477fc5b646..c2c8930d9b 100644 --- a/test/decompiler/reference/engine/debug/viewer_REF.gc +++ b/test/decompiler/reference/engine/debug/viewer_REF.gc @@ -125,9 +125,9 @@ (defbehavior init-viewer viewer ((arg0 string)) (let ((s2-0 (load-to-heap-by-name (-> (if (-> self entity) - (-> self entity extra level) - (-> *level* level-default) - ) + (-> self entity extra level) + (-> *level* level-default) + ) art-group ) arg0 @@ -143,20 +143,18 @@ (when s2-0 (dotimes (s1-0 (-> s2-0 length)) (cond - ((and - (not s4-0) - (= (-> s2-0 data s1-0 type) merc-ctrl) - (or (zero? (length viewer-geo-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-geo-name)) - ) + ((and (not s4-0) + (= (-> s2-0 data s1-0 type) merc-ctrl) + (or (zero? (length viewer-geo-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-geo-name)) + ) (set! s4-0 s1-0) ) ((= (-> s2-0 data s1-0 type) art-joint-geo) (set! s3-0 s1-0) ) - ((and - (= (-> s2-0 data s1-0 type) art-joint-anim) - (or (zero? (length viewer-ja-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-ja-name)) - ) + ((and (= (-> s2-0 data s1-0 type) art-joint-anim) + (or (zero? (length viewer-ja-name)) (string= (art-part-name (-> s2-0 data s1-0 name)) viewer-ja-name)) + ) (set! s5-0 s1-0) ) ) diff --git a/test/decompiler/reference/engine/dma/dma-disasm_REF.gc b/test/decompiler/reference/engine/dma/dma-disasm_REF.gc index c36a345e98..b7f36c07c4 100644 --- a/test/decompiler/reference/engine/dma/dma-disasm_REF.gc +++ b/test/decompiler/reference/engine/dma/dma-disasm_REF.gc @@ -582,11 +582,10 @@ (cond (end-condition ) - ((or - (= (-> current-tag id) (dma-tag-id ref)) - (= (-> current-tag id) (dma-tag-id refs)) - (zero? (-> current-tag id)) - ) + ((or (= (-> current-tag id) (dma-tag-id ref)) + (= (-> current-tag id) (dma-tag-id refs)) + (zero? (-> current-tag id)) + ) (set! addr (-> current-tag addr)) (set! qwc (the-as int (-> current-tag qwc))) (when mode-2 diff --git a/test/decompiler/reference/engine/draw/process-drawable_REF.gc b/test/decompiler/reference/engine/draw/process-drawable_REF.gc index 1542145be3..9418bee192 100644 --- a/test/decompiler/reference/engine/draw/process-drawable_REF.gc +++ b/test/decompiler/reference/engine/draw/process-drawable_REF.gc @@ -215,9 +215,9 @@ ) (add-connection (-> (if (-> self entity) - (-> self entity extra level) - (-> *level* level-default) - ) + (-> self entity extra level) + (-> *level* level-default) + ) foreground-draw-engine (-> self draw sink-group merc-sink foreground-texture-page) ) @@ -493,9 +493,9 @@ (set! (-> v1-26 color-mult quad) (-> (new 'static 'vector :x 1.0 :y 1.0 :z 1.0 :w 1.0) quad)) (set! (-> v1-26 color-emissive quad) (-> (new 'static 'vector) quad)) (set! (-> v1-26 level-index) (the-as uint (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) + (-> obj entity extra level) + (-> *level* level-default) + ) index ) ) @@ -574,15 +574,15 @@ ) (else (set! (-> s3-0 skeleton bones 0 transform vector 3 quad) (-> (the-as vector (get-property-struct - (-> sv-16 extra) - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (-> sv-16 extra) + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) quad ) ) @@ -715,10 +715,10 @@ (defbehavior ja-aframe process-drawable ((arg0 float) (arg1 int)) (let ((v1-3 (-> self skel root-channel arg1 frame-group))) (/ (- arg0 (if (and v1-3 (nonzero? v1-3)) - (-> v1-3 artist-base) - 0.0 - ) - ) + (-> v1-3 artist-base) + 0.0 + ) + ) (if v1-3 (-> v1-3 artist-step) 1.0 @@ -763,21 +763,20 @@ ;; definition for function ja-channel-push! (defbehavior ja-channel-push! process-drawable ((arg0 int) (arg1 int)) (cond - ((or - (zero? (-> self skel active-channels)) - (zero? arg1) - (when (>= (+ (-> self skel active-channels) arg0) (-> self skel allocated-length)) - (format - 0 - "WARNING: ~A could not do (ja-channel-push ~D) because it has ~D/~D channels.~%" - self - arg0 - (-> self skel active-channels) - (-> self skel allocated-length) + ((or (zero? (-> self skel active-channels)) + (zero? arg1) + (when (>= (+ (-> self skel active-channels) arg0) (-> self skel allocated-length)) + (format + 0 + "WARNING: ~A could not do (ja-channel-push ~D) because it has ~D/~D channels.~%" + self + arg0 + (-> self skel active-channels) + (-> self skel allocated-length) + ) + #t ) - #t ) - ) (ja-channel-set! arg0) ) (else @@ -868,8 +867,8 @@ ;; definition for function ja-group-size (defbehavior ja-group-size process-drawable () (if (< (the-as int (-> self skel root-channel)) - (the-as int (-> self skel channel (-> self skel active-channels))) - ) + (the-as int (-> self skel channel (-> self skel active-channels))) + ) (-> self skel root-channel 0 group-size) 0 ) @@ -1030,21 +1029,19 @@ ;; definition for function process-drawable-delay-player (defbehavior process-drawable-delay-player process-drawable ((arg0 int)) - (while (and - *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) (suspend) ) (set! (-> self state-time) (-> *display* base-frame-counter)) (process-grab? *target*) - (while (or - (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - ) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + ) (suspend) ) (while (< (- (-> *display* base-frame-counter) (-> self state-time)) arg0) @@ -1153,10 +1150,9 @@ (set! s5-0 (cond ((valid? (-> s2-0 frame-group) art-joint-anim "joint-control frame-group" #t *valid-con*) (when (not - (and - (>= (the int (-> s2-0 frame-num)) 0) - (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) - ) + (and (>= (the int (-> s2-0 frame-num)) 0) + (< (the int (-> s2-0 frame-num)) (-> s2-0 frame-group data 0 length)) + ) ) (format *valid-con* diff --git a/test/decompiler/reference/engine/engine/connect_REF.gc b/test/decompiler/reference/engine/engine/connect_REF.gc index 1efe1898f0..3648db8523 100644 --- a/test/decompiler/reference/engine/engine/connect_REF.gc +++ b/test/decompiler/reference/engine/engine/connect_REF.gc @@ -136,10 +136,9 @@ ;; definition for method 11 of type connection (defmethod belongs-to-engine? connection ((obj connection) (arg0 engine)) - (and - (< (the-as int arg0) (the-as int obj)) - (< (the-as int obj) (the-as int (-> arg0 data (-> arg0 allocated-length)))) - ) + (and (< (the-as int arg0) (the-as int obj)) + (< (the-as int obj) (the-as int (-> arg0 data (-> arg0 allocated-length)))) + ) ) ;; definition for method 21 of type engine diff --git a/test/decompiler/reference/engine/entity/actor-link-h_REF.gc b/test/decompiler/reference/engine/entity/actor-link-h_REF.gc index f34953b629..ab3d73d1ac 100644 --- a/test/decompiler/reference/engine/entity/actor-link-h_REF.gc +++ b/test/decompiler/reference/engine/entity/actor-link-h_REF.gc @@ -371,8 +371,7 @@ ) (dotimes (alt-actor-idx alt-actor-count) (let ((a0-3 (entity-actor-lookup (-> arg0 entity) 'alt-actor alt-actor-idx))) - (if (or - (not a0-3) + (if (or (not a0-3) (zero? (logand (-> (the-as entity-links (-> a0-3 extra)) perm status) (entity-perm-status complete))) ) (+! incomplete-count 1) diff --git a/test/decompiler/reference/engine/entity/relocate_REF.gc b/test/decompiler/reference/engine/entity/relocate_REF.gc index 8e11e69624..3f0b448486 100644 --- a/test/decompiler/reference/engine/entity/relocate_REF.gc +++ b/test/decompiler/reference/engine/entity/relocate_REF.gc @@ -20,34 +20,30 @@ (let ((v1-7 (-> obj connection-list next1))) (while (the-as connection v1-7) (let ((a0-14 (-> v1-7 prev1))) - (if (and - (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) - (< (the-as int a0-14) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a0-14) (-> *kernel-context* relocating-min)) + (< (the-as int a0-14) (-> *kernel-context* relocating-max)) + ) (&+! (-> v1-7 prev1) arg0) ) ) (let ((a0-19 (-> (the-as connection v1-7) param1))) - (if (and - (>= (the-as int a0-19) (-> *kernel-context* relocating-min)) - (< (the-as int a0-19) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a0-19) (-> *kernel-context* relocating-min)) + (< (the-as int a0-19) (-> *kernel-context* relocating-max)) + ) (&+! (-> (the-as connection v1-7) param1) arg0) ) ) (let ((a0-24 (-> (the-as connection v1-7) param2))) - (if (and - (>= (the-as int a0-24) (-> *kernel-context* relocating-min)) - (< (the-as int a0-24) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a0-24) (-> *kernel-context* relocating-min)) + (< (the-as int a0-24) (-> *kernel-context* relocating-max)) + ) (&+! (-> (the-as connection v1-7) param2) arg0) ) ) (let ((a0-29 (-> (the-as connection v1-7) param3))) - (if (and - (>= (the-as int a0-29) (-> *kernel-context* relocating-min)) - (< (the-as int a0-29) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a0-29) (-> *kernel-context* relocating-min)) + (< (the-as int a0-29) (-> *kernel-context* relocating-max)) + ) (&+! (-> (the-as connection v1-7) param3) arg0) ) ) @@ -55,18 +51,16 @@ ) ) (let ((v1-10 (-> obj self))) - (if (and - (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) - (< (the-as int v1-10) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int v1-10) (-> *kernel-context* relocating-min)) + (< (the-as int v1-10) (-> *kernel-context* relocating-max)) + ) (&+! (-> obj self) arg0) ) ) (let ((v1-15 (-> obj ppointer))) - (if (and - (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) - (< (the-as int v1-15) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int v1-15) (-> *kernel-context* relocating-min)) + (< (the-as int v1-15) (-> *kernel-context* relocating-max)) + ) (&+! (-> obj ppointer) arg0) ) ) @@ -222,10 +216,9 @@ (&+! (-> obj ripple) arg0) ) (let ((v1-14 (-> obj shadow-ctrl))) - (if (and - (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) - (< (the-as int v1-14) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int v1-14) (-> *kernel-context* relocating-min)) + (< (the-as int v1-14) (-> *kernel-context* relocating-max)) + ) (&+! (-> obj shadow-ctrl) arg0) ) ) @@ -255,18 +248,16 @@ ) (&+! (-> a2-2 bone) arg0) (let ((a3-6 (-> a2-2 param1))) - (if (and - (>= (the-as int a3-6) (-> *kernel-context* relocating-min)) - (< (the-as int a3-6) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a3-6) (-> *kernel-context* relocating-min)) + (< (the-as int a3-6) (-> *kernel-context* relocating-max)) + ) (&+! (-> a2-2 param1) arg0) ) ) (let ((a3-11 (-> a2-2 param2))) - (if (and - (>= (the-as int a3-11) (-> *kernel-context* relocating-min)) - (< (the-as int a3-11) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a3-11) (-> *kernel-context* relocating-min)) + (< (the-as int a3-11) (-> *kernel-context* relocating-max)) + ) (&+! (-> a2-2 param2) arg0) ) ) @@ -338,10 +329,9 @@ (let* ((a0-3 (-> obj data v1-2)) (a2-0 (-> a0-3 origin)) ) - (if (and - (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) - (< (the-as int a2-0) (-> *kernel-context* relocating-max)) - ) + (if (and (>= (the-as int a2-0) (-> *kernel-context* relocating-min)) + (< (the-as int a2-0) (-> *kernel-context* relocating-max)) + ) (&+! (-> a0-3 origin) arg0) ) ) diff --git a/test/decompiler/reference/engine/game/collectables_REF.gc b/test/decompiler/reference/engine/game/collectables_REF.gc index 3d807a4153..ee006067eb 100644 --- a/test/decompiler/reference/engine/game/collectables_REF.gc +++ b/test/decompiler/reference/engine/game/collectables_REF.gc @@ -70,10 +70,9 @@ ) ) (cond - ((or - (= (vector-length (-> obj root-override transv)) 0.0) - (logtest? (-> obj fact options) (fact-options fop6)) - ) + ((or (= (vector-length (-> obj root-override transv)) 0.0) + (logtest? (-> obj fact options) (fact-options fop6)) + ) (vector-reset! (-> obj root-override transv)) ) (else @@ -410,13 +409,11 @@ ) ((begin (set! arg0 - (and - (or - (not arg2) - (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flags suck))) - ) - arg0 - ) + (and (or (not arg2) + (or (< f0-0 (-> *FACT-bank* suck-suck-dist)) (logtest? (-> self flags) (collectable-flags suck))) + ) + arg0 + ) ) arg0 ) @@ -439,10 +436,9 @@ (vector+! (-> self base) (the-as vector gp-2) s5-2) ) ) - ((and arg2 (and - (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) - (zero? (logand (-> self flags) (collectable-flags suck))) - ) + ((and arg2 (and (< (+ 4096.0 (-> *FACT-bank* suck-bounce-dist)) f0-0) + (zero? (logand (-> self flags) (collectable-flags suck))) + ) ) (go-virtual wait) ) @@ -527,15 +523,13 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) - (when (and - (or (= arg2 'touch) (= arg2 'attack)) - (and - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - (!= (-> self next-state name) 'pickup) - (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - ) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (!= (-> 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)) (go-virtual pickup #f (process->handle arg0)) ) @@ -543,13 +537,12 @@ object (cond ((= arg2 'eco-blue) - (when (and - (zero? (logand (-> self flags) (collectable-flags fading ignore-blue))) - (!= (-> self next-state name) 'pickup) - (begin (check-blue-suck (the-as process-drawable arg0)) #t) - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - ) + (when (and (zero? (logand (-> self flags) (collectable-flags fading ignore-blue))) + (!= (-> self next-state name) 'pickup) + (begin (check-blue-suck (the-as process-drawable arg0)) #t) + (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + ) (logclear! (-> self mask) (process-mask actor-pause)) (go-virtual notice-blue (process->handle arg0)) ) @@ -609,12 +602,11 @@ ) :enter (behavior () - (if (and - (logtest? (-> self fact options) (fact-options fop6 can-collect)) - (logtest? (-> self flags) (collectable-flags can-collect)) - (!= (-> self next-state name) 'pickup) - (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) + (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + (logtest? (-> self flags) (collectable-flags can-collect)) + (!= (-> self next-state name) 'pickup) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) (go-virtual pickup #f (process->handle *target*)) ) (none) @@ -642,17 +634,15 @@ (logior! (-> self mask) (process-mask actor-pause)) ) (set! (-> self base quad) (-> self root-override trans quad)) - (if (and - (logtest? (-> self fact options) (fact-options can-collect)) - (zero? (logand (-> self flags) (collectable-flags ignore-blue))) - ) + (if (and (logtest? (-> self fact options) (fact-options can-collect)) + (zero? (logand (-> self flags) (collectable-flags ignore-blue))) + ) (go-virtual notice-blue (process->handle *target*)) ) - (if (and - (logtest? (-> self fact options) (fact-options fop6 can-collect)) - (!= (-> self next-state name) 'pickup) - (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) + (if (and (logtest? (-> self fact options) (fact-options fop6 can-collect)) + (!= (-> self next-state name) 'pickup) + (send-event *target* 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) + ) (go-virtual pickup #f (process->handle *target*)) ) ) @@ -672,10 +662,9 @@ (let ((gp-0 (-> self part)) (s5-0 (-> self root-override root-prim prim-core)) ) - (when (and - (logtest? (-> self flags) (collectable-flags fade)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout)) - ) + (when (and (logtest? (-> self flags) (collectable-flags fade)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout)) + ) (let ((v1-10 (- 300 (- (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self fadeout-timeout))))) (cond ((< v1-10 0) @@ -708,15 +697,13 @@ :virtual #t :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (and - (or (= arg2 'touch) (= arg2 'attack)) - (and - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - (!= (-> self next-state name) 'pickup) - (send-event arg0 'get-pickup (-> self fact pickup-type) (-> self fact pickup-amount)) - ) - ) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (!= (-> 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)) (go-virtual pickup #f (process->handle arg0)) ) @@ -851,11 +838,10 @@ :code (behavior ((arg0 object) (arg1 handle)) (clear-collide-with-as (-> self root-override)) - (if (not (or - (= (-> self fact pickup-type) (pickup-type eco-pill)) + (if (not (or (= (-> self fact pickup-type) (pickup-type eco-pill)) (logtest? (-> self fact options) (fact-options powerup)) ) - ) + ) (send-event (handle->process arg1) 'powerup (-> self fact pickup-type) (-> self fact pickup-amount)) ) (if (nonzero? (-> self sound)) @@ -974,7 +960,10 @@ (defstate die (eco-collectable) :virtual #t :code - (behavior () (process-entity-status! self (entity-perm-status dead) #t) (none)) + (behavior () + (process-entity-status! self (entity-perm-status dead) #t) + (none) + ) ) ;; definition of type eco @@ -1297,20 +1286,17 @@ ;; definition for method 12 of type money (defmethod run-logic? money ((obj money)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (and - (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status drwf03)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override 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-status drwf04))) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (logtest? (-> obj draw status) (draw-status drwf03)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) + (vector-vector-distance (-> obj root-override 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-status drwf04))) + ) ) - ) ) ;; definition for method 10 of type money @@ -1434,12 +1420,12 @@ (set! (-> obj fact) (new 'process 'fact-info obj (pickup-type money) (the-as float 1.0))) (let ((a0-10 (-> obj entity))) (if (when a0-10 - (let ((a0-11 (-> a0-10 extra perm task))) - (if a0-11 - (= a0-11 (game-task none)) - ) - ) + (let ((a0-11 (-> a0-10 extra perm task))) + (if a0-11 + (= a0-11 (game-task none)) + ) ) + ) (set! (-> obj entity extra perm task) (game-task complete)) ) ) @@ -1661,20 +1647,17 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (local-vars (v0-3 none)) - (when (and - (or (= arg2 'touch) (= arg2 'attack)) - (and - (logtest? (-> self flags) (collectable-flags can-collect)) - (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) - (and - (not (handle->process (-> *game-info* other-camera-handle))) - (not *progress-process*) - (!= (-> self next-state name) 'pickup) - *target* - (zero? (logand (-> *target* state-flags) #x8100)) - ) - ) - ) + (when (and (or (= arg2 'touch) (= arg2 'attack)) + (and (logtest? (-> self flags) (collectable-flags can-collect)) + (>= (- (-> *display* base-frame-counter) (-> self birth-time)) (-> self collect-timeout)) + (and (not (handle->process (-> *game-info* other-camera-handle))) + (not *progress-process*) + (!= (-> self next-state name) 'pickup) + *target* + (zero? (logand (-> *target* state-flags) #x8100)) + ) + ) + ) (push-setting! *setting-control* self 'allow-progress #f 0.0 0) (copy-settings-from-target! *setting-control*) (logclear! (-> self mask) (process-mask actor-pause)) @@ -1815,14 +1798,13 @@ (set! (-> self state-object) #f) (kill-and-free-particles (-> self part)) (logior! (-> self draw status) (draw-status drwf05)) - (if (not (or - (logtest? - (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 4096 - ) - (and *target* (logtest? (-> *target* control root-prim prim-core action) 512)) - ) - ) + (if (not + (or (logtest? (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) + 4096 + ) + (and *target* (logtest? (-> *target* control root-prim prim-core action) 512)) + ) + ) (send-event *camera* 'teleport-to-other-start-string) ) ) @@ -1946,12 +1928,11 @@ gp-4 (lambda :behavior collectable ((arg0 game-task)) - (while (or - (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - (str-is-playing?) - ) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + (str-is-playing?) + ) (suspend) ) (cond @@ -2318,15 +2299,14 @@ (set! (-> self jump-pos y) (+ 4096.0 (-> self jump-pos y))) (go-virtual jump) ) - ((and - gp-1 - (zero? (logand - (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) - 128 - ) - ) - (zero? (logand (-> self fact options) (fact-options fop7))) - ) + ((and gp-1 + (zero? + (logand (the-as int (res-lump-value (-> self entity) 'options uint128 :time (the-as float -1000000000.0))) + 128 + ) + ) + (zero? (logand (-> self fact options) (fact-options fop7))) + ) (set! (-> self jump-pos quad) (-> (the-as vector gp-1) quad)) (set! (-> self jump-pos y) (+ 4096.0 (-> self jump-pos y))) (go-virtual jump) @@ -2387,7 +2367,11 @@ (none) ) :post - (behavior () (dummy-47 (-> self root-override)) (animate self) (none)) + (behavior () + (dummy-47 (-> self root-override)) + (animate self) + (none) + ) ) ;; definition for function fuel-cell-init-as-clone @@ -2556,10 +2540,9 @@ (if (nonzero? s5-2) (close-specific-task! (the-as game-task s5-2) (task-status need-hint)) ) - (when (and - (= (get-reminder s4-1 0) 127) - (and (-> self entity) (not (task-complete? *game-info* (the-as game-task s5-2)))) - ) + (when (and (= (get-reminder s4-1 0) 127) + (and (-> self entity) (not (task-complete? *game-info* (the-as game-task s5-2)))) + ) (if (and *target* (logtest? (-> *target* control root-prim prim-core action) #x7200) (not arg0)) (logior! (-> self fact options) (fact-options fop6 fop7)) ) @@ -2957,37 +2940,36 @@ f30-0 (let ((s1-0 (get-death-count *game-info* #f))) (set! s3-0 (pickup-type eco-pill)) - (set! f30-0 (cond - ((and - (= s1-0 1) - *target* - (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.1))) - ) - (set! s3-0 (pickup-type eco-green)) - 1.0 - ) - ((and - (< 1 s1-0) - *target* - (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.05))) - ) - (set! s3-0 (pickup-type eco-green)) - 1.0 - ) - ((< 20 *eco-pill-count*) - (return (the-as (pointer process) #f)) - f30-0 - ) - ((< 10 *eco-pill-count*) - 1.0 - ) - ((type-type? (-> obj type) fact-info-enemy) - (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3)) - ) - (else - (+ (rand-vu-float-range (the-as float 2.0) (+ 3.0 f30-0)) (the float arg3)) - ) + (set! f30-0 + (cond + ((and (= s1-0 1) + *target* + (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.1))) ) + (set! s3-0 (pickup-type eco-green)) + 1.0 + ) + ((and (< 1 s1-0) + *target* + (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? (the-as float 0.05))) + ) + (set! s3-0 (pickup-type eco-green)) + 1.0 + ) + ((< 20 *eco-pill-count*) + (return (the-as (pointer process) #f)) + f30-0 + ) + ((< 10 *eco-pill-count*) + 1.0 + ) + ((type-type? (-> obj type) fact-info-enemy) + (+ (rand-vu-float-range (the-as float 3.0) (+ 5.0 f30-0)) (the float arg3)) + ) + (else + (+ (rand-vu-float-range (the-as float 2.0) (+ 3.0 f30-0)) (the float arg3)) + ) + ) ) ) ) @@ -2996,16 +2978,16 @@ (set! (-> s2-1 y) (+ 12288.0 (-> s2-1 y))) (let ((s1-1 (new 'stack-no-clear 'collide-tri-result))) (if (>= (fill-and-probe-using-y-probe - *collide-cache* - s2-1 - (the-as float 81920.0) - (the-as uint 1) - (the-as process #f) - s1-1 - (the-as uint 1) - ) - 0.0 + *collide-cache* + s2-1 + (the-as float 81920.0) + (the-as uint 1) + (the-as process #f) + s1-1 + (the-as uint 1) ) + 0.0 + ) (set! (-> s2-1 quad) (-> s1-1 intersect quad)) (set! (-> s2-1 quad) (-> obj process root trans quad)) ) @@ -3277,20 +3259,18 @@ (defstate vent-wait-for-touch (vent) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and - (or (= arg2 'touch) (= arg2 'attack)) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'get-pickup) - (set! (-> a1-1 param 0) (the-as uint (-> self fact pickup-type))) - (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-amount))) - (and - (= (send-event-function arg0 a1-1) #t) - (or (logtest? (-> self fact options) (fact-options powerup)) (send-event arg0 'powerup)) - ) - ) - ) + (if (and (or (= arg2 'touch) (= arg2 'attack)) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'get-pickup) + (set! (-> a1-1 param 0) (the-as uint (-> self fact pickup-type))) + (set! (-> a1-1 param 1) (the-as uint (-> self fact pickup-amount))) + (and (= (send-event-function arg0 a1-1) #t) + (or (logtest? (-> self fact options) (fact-options powerup)) (send-event arg0 'powerup)) + ) + ) + ) (go vent-pickup (process->handle arg0)) ) (vent-standard-event-handler arg0 arg1 arg2 arg3) @@ -3318,12 +3298,13 @@ ;; failed to figure out what this is: (defstate vent-blocked (vent) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('show) - (go vent-wait-for-touch) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('show) + (go vent-wait-for-touch) + ) + ) + ) :code (behavior () (while #t @@ -3496,7 +3477,3 @@ (initialize obj arg0 (pickup-type eco-blue)) (none) ) - - - - diff --git a/test/decompiler/reference/engine/game/crates_REF.gc b/test/decompiler/reference/engine/game/crates_REF.gc index f8c4e0cd03..5aa9c6eb37 100644 --- a/test/decompiler/reference/engine/game/crates_REF.gc +++ b/test/decompiler/reference/engine/game/crates_REF.gc @@ -649,11 +649,10 @@ (('iron) (case (-> arg3 param 1) (('flop 'uppercut 'explode 'darkeco 'eco-yellow 'bonk 'racer 'tube 'flut-bonk 'flut-attack) - (if (and - (logtest? (-> self fact options) (fact-options fop11)) - *target* - (zero? (logand (-> *target* control root-prim prim-core action) 512)) - ) + (if (and (logtest? (-> self fact options) (fact-options fop11)) + *target* + (zero? (logand (-> *target* control root-prim prim-core action) 512)) + ) (return #f) ) (increment-success-for-hint (game-text-id sidekick-speech-hint-crate-iron)) @@ -664,8 +663,8 @@ (else (when (and (!= s4-0 (-> self incomming-attack-id)) (= (-> self root-override trans y) (-> self base y))) (if (not - (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) - ) + (and (!= *kernel-boot-message* 'play) (= (-> *setting-control* current language) (language-enum japanese))) + ) (level-hint-spawn (game-text-id sage-voicebox-hint-crate-iron) "sagevb36" @@ -837,12 +836,11 @@ ) ) (('eco-blue) - (if (not (or - (= (-> self defense) 'darkeco) + (if (not (or (= (-> self defense) 'darkeco) (or (= (-> self next-state name) 'notice-blue) (= (-> self next-state name) 'die)) (!= (-> self root-override trans y) (-> self base y)) ) - ) + ) (go-virtual notice-blue (process->handle arg0)) ) ) @@ -1035,12 +1033,11 @@ (if (nonzero? (-> self sound)) (stop! (-> self sound)) ) - (if (and *target* (and - (logtest? (-> *target* control root-prim prim-core action) #x7200) - (!= (-> self fact pickup-type) 6) - (not arg0) - ) - ) + (if (and *target* (and (logtest? (-> *target* control root-prim prim-core action) #x7200) + (!= (-> self fact pickup-type) 6) + (not arg0) + ) + ) (logior! (-> self fact options) (fact-options fop6)) ) (when (not arg0) @@ -1211,19 +1208,18 @@ (-> (method-of-type crate die) trans) :code (behavior () - (when (or - (= (-> self fact pickup-type) (pickup-type money)) - (= (-> self defense) 'iron) - (= (-> self defense) 'steel) - ) + (when (or (= (-> self fact pickup-type) (pickup-type money)) + (= (-> self defense) 'iron) + (= (-> self defense) 'steel) + ) (let ((a0-4 (-> self entity))) (if (when a0-4 - (let ((a0-5 (-> a0-4 extra perm task))) - (if a0-5 - (= a0-5 (game-task none)) - ) - ) + (let ((a0-5 (-> a0-4 extra perm task))) + (if a0-5 + (= a0-5 (game-task none)) + ) ) + ) (set! (-> self entity extra perm task) (game-task complete)) ) ) @@ -1578,14 +1574,12 @@ :virtual #t :trans (behavior () - (when (and - (and - *target* - (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 450) - (rand-vu-percent? 0.03) - ) + (when (and (and *target* + (>= 327680.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 450) + (rand-vu-percent? 0.03) + ) (spawn (-> self part) (-> self root-override trans)) (activate! (-> self smush) 0.2 90 150 1.0 1.0) (logclear! (-> self mask) (process-mask sleep-code)) diff --git a/test/decompiler/reference/engine/game/effect-control_REF.gc b/test/decompiler/reference/engine/game/effect-control_REF.gc index b8806107cc..501903ff63 100644 --- a/test/decompiler/reference/engine/game/effect-control_REF.gc +++ b/test/decompiler/reference/engine/game/effect-control_REF.gc @@ -325,15 +325,14 @@ ) (let ((v1-10 (symbol->string arg0))) (cond - ((and - (= (-> v1-10 data 0) 101) - (= (-> v1-10 data 1) 102) - (= (-> v1-10 data 2) 102) - (= (-> v1-10 data 3) 101) - (= (-> v1-10 data 4) 99) - (= (-> v1-10 data 5) 116) - (= (-> v1-10 data 6) 45) - ) + ((and (= (-> v1-10 data 0) 101) + (= (-> v1-10 data 1) 102) + (= (-> v1-10 data 2) 102) + (= (-> v1-10 data 3) 101) + (= (-> v1-10 data 4) 99) + (= (-> v1-10 data 5) 116) + (= (-> v1-10 data 6) 45) + ) (let* ((s3-1 (-> obj process root)) (v1-14 (if (and (nonzero? s3-1) (type-type? (-> s3-1 type) collide-shape-moving)) s3-1 @@ -349,14 +348,13 @@ ) ) ((let ((v1-18 (symbol->string arg0))) - (and - (= (-> v1-18 data 0) 103) - (= (-> v1-18 data 1) 114) - (= (-> v1-18 data 2) 111) - (= (-> v1-18 data 3) 117) - (= (-> v1-18 data 4) 112) - (= (-> v1-18 data 5) 45) - ) + (and (= (-> v1-18 data 0) 103) + (= (-> v1-18 data 1) 114) + (= (-> v1-18 data 2) 111) + (= (-> v1-18 data 3) 117) + (= (-> v1-18 data 4) 112) + (= (-> v1-18 data 5) 45) + ) ) (set! s3-0 (cond ((zero? s3-0) @@ -1139,14 +1137,14 @@ ) ) (if (and (nonzero? (-> gp-0 fo-max)) (let ((f30-1 (* 4096.0 (the float (-> gp-0 fo-max))))) - (set! sv-160 vector-vector-distance) - (let ((a0-6 (ear-trans)) - (a1-8 s5-0) - ) - (< f30-1 (sv-160 a0-6 a1-8)) - ) + (set! sv-160 vector-vector-distance) + (let ((a0-6 (ear-trans)) + (a1-8 s5-0) + ) + (< f30-1 (sv-160 a0-6 a1-8)) ) - ) + ) + ) (return 0) ) (when *debug-effect-control* diff --git a/test/decompiler/reference/engine/game/game-info_REF.gc b/test/decompiler/reference/engine/game/game-info_REF.gc index 499e94bfd8..670f5a502d 100644 --- a/test/decompiler/reference/engine/game/game-info_REF.gc +++ b/test/decompiler/reference/engine/game/game-info_REF.gc @@ -447,8 +447,7 @@ (cond ((>= amount 0.0) (when (< 0.0 amount) - (if (or - (!= (handle->process source-handle) (handle->process (-> obj eco-source))) + (if (or (!= (handle->process source-handle) (handle->process (-> obj eco-source))) (>= (- (-> *display* base-frame-counter) (the-as int (-> obj eco-source-time))) 150) ) (sound-play-by-name (static-sound-name "get-green-eco") (new-sound-id) 1024 0 0 1 #t) @@ -480,10 +479,9 @@ ) ) (b! - (and - (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) 512) - (type-type? (-> (handle->process source-handle) type) vent) - ) + (and (logtest? (-> (the-as collide-shape (-> obj process root)) root-prim prim-core action) 512) + (type-type? (-> (handle->process source-handle) type) vent) + ) cfg-80 :delay (nop!) @@ -517,11 +515,10 @@ ) (((pickup-type fuel-cell)) (let ((s4-2 (the int amount))) - (if (not (or - (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2)) + (if (not (or (task-complete? (-> (the-as target (-> obj process)) game) (the-as game-task s4-2)) (>= (the-as uint 1) (the-as uint s4-2)) ) - ) + ) (set! (-> obj fuel-cell-pickup-time) (the-as uint (-> *display* base-frame-counter))) ) ) @@ -567,17 +564,16 @@ ) ) (if (>= (the-as int (- (-> obj eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> obj eco-pickup-time)))) - ) - ) - (the-as int (-> *FACT-bank* eco-full-timeout)) - ) + (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> obj eco-pickup-time)))) + ) + ) + (the-as int (-> *FACT-bank* eco-full-timeout)) + ) (set! (-> obj eco-level) 2.0) ) - (when (not (and - (= (handle->process source-handle) (handle->process (-> obj eco-source))) - (< (- (-> *display* base-frame-counter) (the-as int (-> obj eco-source-time))) 150) - ) + (when (not (and (= (handle->process source-handle) (handle->process (-> obj eco-source))) + (< (- (-> *display* base-frame-counter) (the-as int (-> obj eco-source-time))) 150) + ) ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 127 60) (cpad-set-buzz! (-> *cpad-list* cpads 0) 0 17 60) diff --git a/test/decompiler/reference/engine/game/game-save_REF.gc b/test/decompiler/reference/engine/game/game-save_REF.gc index 9ffd771de4..dfbd7303aa 100644 --- a/test/decompiler/reference/engine/game/game-save_REF.gc +++ b/test/decompiler/reference/engine/game/game-save_REF.gc @@ -1322,15 +1322,15 @@ (sprite-get-user-hvdf (-> self part matrix)) 1842.0 (the float (+ (the int (* 0.5 (- (* (if (= (get-aspect-ratio) 'aspect16x9) - 370.0 - 360.0 - ) - (-> *video-parms* relative-y-scale) - ) - (the float (-> *video-parms* screen-sy)) - ) - ) - ) + 370.0 + 360.0 + ) + (-> *video-parms* relative-y-scale) + ) + (the float (-> *video-parms* screen-sy)) + ) + ) + ) 2048 ) ) @@ -1927,10 +1927,9 @@ auto-save-post (defun auto-save-check () (when (and (-> *setting-control* current auto-save) (not (handle->process (-> *game-info* auto-save-proc)))) (mc-get-slot-info 0 *auto-save-info*) - (if (and - (nonzero? (-> *auto-save-info* known)) - (or (zero? (-> *auto-save-info* handle)) (!= (-> *auto-save-info* handle) (-> *game-info* auto-save-card))) - ) + (if (and (nonzero? (-> *auto-save-info* known)) + (or (zero? (-> *auto-save-info* handle)) (!= (-> *auto-save-info* handle) (-> *game-info* auto-save-card))) + ) (auto-save-command 'error 0 0 *default-pool*) ) ) diff --git a/test/decompiler/reference/engine/game/generic-obs_REF.gc b/test/decompiler/reference/engine/game/generic-obs_REF.gc index c5be1082da..f278a74403 100644 --- a/test/decompiler/reference/engine/game/generic-obs_REF.gc +++ b/test/decompiler/reference/engine/game/generic-obs_REF.gc @@ -95,12 +95,11 @@ :code (behavior () (while #t - (when (and - *target* - (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) - (logtest? (-> *target* control root-prim prim-core action) 64) - (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range)))) - ) + (when (and *target* + (< (vector-vector-distance (-> self root trans) (-> *target* control unknown-vector90)) (-> self range)) + (logtest? (-> *target* control root-prim prim-core action) 64) + (< (-> *target* control unknown-vector90 y) (+ (-> self root trans y) (* 0.5 (-> self range)))) + ) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 1) @@ -433,12 +432,12 @@ (case (-> self anim-mode) (('play1 'play) (>= (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -2 ) ) @@ -474,14 +473,15 @@ (if (!= (-> self cur-post-hook) (-> self new-post-hook)) (set! (-> self cur-post-hook) (-> self new-post-hook)) ) - (when (and (-> self new-joint-anim) (nonzero? (-> self skel)) (and - (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self new-joint-anim) - ) - (!= (-> self anim-mode) 'clone-anim) - ) + (when (and (-> self new-joint-anim) + (nonzero? (-> self skel)) + (and (!= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self new-joint-anim) + ) + (!= (-> self anim-mode) 'clone-anim) + ) ) (ja-channel-push! 1 (the-as int (-> self new-joint-anim-blend))) (let ((gp-0 (-> self skel root-channel 0))) @@ -846,17 +846,16 @@ ;; INFO: Return type mismatch object vs symbol. (defbehavior process-release? process ((arg0 process)) (let ((gp-0 (command-get-process arg0 *target*))) - (the-as symbol (if (and - gp-0 - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 1) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'mode)) - (send-event-function gp-0 a1-1) - ) - 'target-grab - ) + (the-as symbol (if (and gp-0 + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 1) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'mode)) + (send-event-function gp-0 a1-1) + ) + 'target-grab + ) (send-event gp-0 'end-mode) #t ) @@ -2121,17 +2120,16 @@ ) ) ) - (if (and - (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-5 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-5 from) self) - (set! (-> a1-5 num-params) 2) - (set! (-> a1-5 message) 'query) - (set! (-> a1-5 param 0) (the-as uint 'powerup)) - (set! (-> a1-5 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-5)) - ) - ) + (if (and (and *target* (>= 32768.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (let ((a1-5 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-5 from) self) + (set! (-> a1-5 num-params) 2) + (set! (-> a1-5 message) 'query) + (set! (-> a1-5 param 0) (the-as uint 'powerup)) + (set! (-> a1-5 param 1) (the-as uint 3)) + (not (send-event-function *target* a1-5)) + ) + ) (level-hint-spawn (game-text-id daxter-launcher-no-eco) "sksp0035" @@ -2180,13 +2178,10 @@ ) :trans (behavior () - (if (or - (or - (not *target*) - (< (-> self active-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (if (or (or (not *target*) (< (-> self active-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 2) @@ -2200,15 +2195,12 @@ ) (spawn (-> self part) (-> self root-override trans)) (sound-play-by-name (static-sound-name "launch-idle") (-> self sound-id) 1024 0 0 1 #t) - (if (and - (and - *target* - (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + (if (and (and *target* (>= (+ 2867.2 (-> self root-override root-prim prim-core world-sphere w)) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) ) - ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 150) - ) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 150) + ) (send-event *target* 'launch (-> self spring-height) (-> self camera) (-> self dest) (-> self seek-time)) ) (none) diff --git a/test/decompiler/reference/engine/game/main_REF.gc b/test/decompiler/reference/engine/game/main_REF.gc index f4abec05c2..952b752c2e 100644 --- a/test/decompiler/reference/engine/game/main_REF.gc +++ b/test/decompiler/reference/engine/game/main_REF.gc @@ -81,10 +81,9 @@ (defun paused? () (the-as symbol - (or - (= *master-mode* 'pause) - (or (and *progress-process* (not (hidden? (-> *progress-process* 0)))) (= *master-mode* 'menu)) - ) + (or (= *master-mode* 'pause) + (or (and *progress-process* (not (hidden? (-> *progress-process* 0)))) (= *master-mode* 'menu)) + ) ) ) @@ -900,49 +899,45 @@ (let ((timeout (scf-get-timeout)) (inactive-timeout (scf-get-inactive-timeout)) ) - (when (and - (or - (and - (nonzero? timeout) - (>= (+ -300000 (-> *display* real-frame-counter)) (the int (* 300.0 (the float timeout)))) - ) - (and - (nonzero? inactive-timeout) - (>= (- (-> *display* base-frame-counter) (-> *cpad-list* cpads 0 change-time)) - (the int (* 300.0 (the float inactive-timeout))) - ) - ) - (= *master-exit* 'force) - ) - (progress-allowed?) - (!= *master-exit* #t) - ) + (when (and (or (and (nonzero? timeout) + (>= (+ -300000 (-> *display* real-frame-counter)) (the int (* 300.0 (the float timeout)))) + ) + (and (nonzero? inactive-timeout) + (>= (- (-> *display* base-frame-counter) (-> *cpad-list* cpads 0 change-time)) + (the int (* 300.0 (the float inactive-timeout))) + ) + ) + (= *master-exit* 'force) + ) + (progress-allowed?) + (!= *master-exit* #t) + ) (let ((game-end-proc (get-process *default-dead-pool* process #x4000))) (if (when game-end-proc - (let ((t9-28 (method-of-type process activate))) - (t9-28 game-end-proc *default-pool* 'process (the-as pointer #x70004000)) - ) - (run-next-time-in-process game-end-proc (lambda :behavior process - () - (set-blackout-frames #x7530) - (set! (-> *setting-control* default allow-pause) #f) - (set! (-> *setting-control* default allow-progress) #f) - (copy-settings-from-target! *setting-control*) - (set! (-> *setting-control* default sfx-volume) 0.0) - (set! (-> *setting-control* default music-volume) 0.0) - (set! (-> *setting-control* default dialog-volume) 0.0) - (set! (-> *setting-control* default ambient-volume) 0.0) - (let ((gp-0 (-> *display* base-frame-counter))) - (until (>= (- (-> *display* base-frame-counter) gp-0) 30) - (suspend) - ) - ) - (kernel-shutdown) - (none) - ) - ) - (-> game-end-proc ppointer) + (let ((t9-28 (method-of-type process activate))) + (t9-28 game-end-proc *default-pool* 'process (the-as pointer #x70004000)) ) + (run-next-time-in-process game-end-proc (lambda :behavior process + () + (set-blackout-frames #x7530) + (set! (-> *setting-control* default allow-pause) #f) + (set! (-> *setting-control* default allow-progress) #f) + (copy-settings-from-target! *setting-control*) + (set! (-> *setting-control* default sfx-volume) 0.0) + (set! (-> *setting-control* default music-volume) 0.0) + (set! (-> *setting-control* default dialog-volume) 0.0) + (set! (-> *setting-control* default ambient-volume) 0.0) + (let ((gp-0 (-> *display* base-frame-counter))) + (until (>= (- (-> *display* base-frame-counter) gp-0) 30) + (suspend) + ) + ) + (kernel-shutdown) + (none) + ) + ) + (-> game-end-proc ppointer) + ) (set! *master-exit* #t) ) ) @@ -1184,9 +1179,9 @@ (label cfg-68) 0 (let ((debug-txt-buf (-> (if *debug-segment* - (-> disp frames (-> disp on-screen) frame debug-buf) - (-> disp frames (-> disp on-screen) frame global-buf) - ) + (-> disp frames (-> disp on-screen) frame debug-buf) + (-> disp frames (-> disp on-screen) frame global-buf) + ) base ) ) @@ -1342,9 +1337,9 @@ (+! (-> v1-220 data 84 count) 1) (+! (-> v1-220 data 84 used) (&- (-> (if *debug-segment* - (-> disp frames (-> disp on-screen) frame debug-buf) - (-> disp frames (-> disp on-screen) frame global-buf) - ) + (-> disp frames (-> disp on-screen) frame debug-buf) + (-> disp frames (-> disp on-screen) frame global-buf) + ) base ) (the-as uint debug-txt-buf) @@ -1422,11 +1417,10 @@ ) ) (cond - ((or - (level-get-with-status *level* 'loaded) - (level-get-with-status *level* 'alive) - (level-get-with-status *level* 'active) - ) + ((or (level-get-with-status *level* 'loaded) + (level-get-with-status *level* 'alive) + (level-get-with-status *level* 'active) + ) (activate-levels! *level*) (when (not arg0) (let ((gp-1 (entity-by-type camera-start))) diff --git a/test/decompiler/reference/engine/game/powerups_REF.gc b/test/decompiler/reference/engine/game/powerups_REF.gc index 280a57971f..74d243df25 100644 --- a/test/decompiler/reference/engine/game/powerups_REF.gc +++ b/test/decompiler/reference/engine/game/powerups_REF.gc @@ -663,25 +663,22 @@ ) ) (cond - ((and - (= (-> self control ground-pat material) (pat-material ice)) - (and - (>= (-> self control unknown-float01) 204.8) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15) - ) - ) + ((and (= (-> self control ground-pat material) (pat-material ice)) + (and (>= (-> self control unknown-float01) 204.8) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 15) + ) + ) (let ((gp-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 74)))) - (if (and - (< (fabs + (if (and (< (fabs (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) gp-0 (-> self control trans)) ) ) - 819.2 - ) - (rand-vu-percent? 0.5) - ) + 819.2 + ) + (rand-vu-percent? 0.5) + ) (sp-launch-particles-var *sp-particle-system-3d* (-> *part-id-table* 2391) @@ -693,17 +690,16 @@ ) ) (let ((gp-1 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self node-list data 70)))) - (if (and - (< (fabs + (if (and (< (fabs (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) gp-1 (-> self control trans)) ) ) - 819.2 - ) - (rand-vu-percent? 0.5) - ) + 819.2 + ) + (rand-vu-percent? 0.5) + ) (sp-launch-particles-var *sp-particle-system-3d* (-> *part-id-table* 2391) @@ -716,11 +712,11 @@ ) (let ((f0-8 (lerp-scale 60.0 90.0 (-> self control unknown-float01) 0.0 81920.0))) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 104) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 104) + ) + ) (set! f0-8 (* 0.75 f0-8)) ) (set! (-> self control unknown-float141) @@ -761,37 +757,35 @@ (set! (-> a0-33 settings shadow-dir y) (-> v1-67 y)) (set! (-> a0-33 settings shadow-dir z) (-> v1-67 z)) ) - (when (and - (!= (-> self fact-info-target eco-level) 0.0) - (>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))) - (the-as int (-> self fact-info-target eco-timeout)) - ) - ) + (when (and (!= (-> self fact-info-target eco-level) 0.0) + (>= (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time))) + (the-as int (-> self fact-info-target eco-timeout)) + ) + ) (set! (-> self fact-info-target eco-level) 0.0) (set! (-> self fact-info-target eco-timeout) 0) (set! (-> self state-flags) (logand -65 (-> self state-flags))) (send-event self 'reset-collide) (stop! (-> self sound)) ) - (when (and - (< 0.0 (-> self fact-info-target eco-level)) - (zero? (logand (-> self state-flags) 512)) - (zero? (logand (-> self draw status) (draw-status drwf01 drwf02))) - (not (movie?)) - (rand-vu-percent? - (lerp-scale - 0.0 - 1.0 - (the float - (- (-> self fact-info-target eco-timeout) - (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))) + (when (and (< 0.0 (-> self fact-info-target eco-level)) + (zero? (logand (-> self state-flags) 512)) + (zero? (logand (-> self draw status) (draw-status drwf01 drwf02))) + (not (movie?)) + (rand-vu-percent? + (lerp-scale + 0.0 + 1.0 + (the float + (- (-> self fact-info-target eco-timeout) + (the-as uint (- (-> *display* game-frame-counter) (the-as int (-> self fact-info-target eco-pickup-time)))) + ) ) - ) - 0.0 - 900.0 - ) - ) - ) + 0.0 + 900.0 + ) + ) + ) (case (-> self fact-info-target eco-type) ((1) (change-sound! (-> self sound) (static-sound-name "yel-eco-jak")) diff --git a/test/decompiler/reference/engine/game/projectiles_REF.gc b/test/decompiler/reference/engine/game/projectiles_REF.gc index 6733dc2b6e..f1a25baf4a 100644 --- a/test/decompiler/reference/engine/game/projectiles_REF.gc +++ b/test/decompiler/reference/engine/game/projectiles_REF.gc @@ -90,12 +90,11 @@ (set! s4-2 (logior s4-2 2)) ) (let ((a0-16 (logand s4-2 (-> gp-0 mask)))) - (when (and - (>= a0-16 (the-as int (-> gp-0 rating))) - (or (zero? (-> gp-0 require)) (logtest? a0-16 (-> gp-0 require))) - (< f30-0 (-> gp-0 best)) - (>= (vector-dot v1-8 (-> gp-0 rot-base)) (-> gp-0 rot-range)) - ) + (when (and (>= a0-16 (the-as int (-> gp-0 rating))) + (or (zero? (-> gp-0 require)) (logtest? a0-16 (-> gp-0 require))) + (< f30-0 (-> gp-0 best)) + (>= (vector-dot v1-8 (-> gp-0 rot-base)) (-> gp-0 rot-range)) + ) (set! (-> gp-0 match) s5-0) (set! (-> gp-0 best) f30-0) (set! (-> gp-0 rating) (the-as uint a0-16)) @@ -794,7 +793,10 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (let ((gp-0 #f)) @@ -865,13 +867,11 @@ (vector-flatten! s5-1 s5-1 (-> arg0 root-override local-normal)) ) (vector-normalize-copy! s4-0 s5-1 1.0) - (if (and - (or - (not (handle->process (-> arg0 last-target))) - (zero? (-> (the-as target (handle->process (-> arg0 last-target))) control root-prim prim-core collide-as)) - ) - (< (vector-dot s4-0 s3-0) 0.0) - ) + (if (and (or (not (handle->process (-> arg0 last-target))) + (zero? (-> (the-as target (handle->process (-> arg0 last-target))) control root-prim prim-core collide-as)) + ) + (< (vector-dot s4-0 s3-0) 0.0) + ) (go (method-of-object arg0 projectile-dissipate)) ) (vector-deg-slerp (-> arg0 root-override transv) s3-0 s4-0 (-> arg0 tween)) @@ -1219,10 +1219,9 @@ ;; Used lq/sq (defmethod dummy-28 projectile-yellow ((obj projectile-yellow)) (cond - ((or - (not (handle->process (-> obj last-target))) - (zero? (-> (the-as target (handle->process (-> obj last-target))) control root-prim prim-core collide-as)) - ) + ((or (not (handle->process (-> obj last-target))) + (zero? (-> (the-as target (handle->process (-> obj last-target))) control root-prim prim-core collide-as)) + ) (cond ((zero? (-> obj target-count)) (let ((s5-0 (find-nearest-attackable @@ -1285,10 +1284,9 @@ (let ((a1-8 (handle->process (-> obj last-target)))) (set! (-> obj target quad) (-> (the-as target a1-8) control root-prim prim-core world-sphere quad)) ) - (if (and - (< (vector-vector-xz-distance (-> obj root-override trans) (-> obj target)) 20480.0) - (< 24576.0 (fabs (- (-> obj target y) (-> obj root-override trans y)))) - ) + (if (and (< (vector-vector-xz-distance (-> obj root-override trans) (-> obj target)) 20480.0) + (< 24576.0 (fabs (- (-> obj target y) (-> obj root-override trans y)))) + ) (set! (-> obj last-target) (the-as handle #f)) ) ) @@ -1440,12 +1438,18 @@ (defstate projectile-impact (projectile-blue) :virtual #t :code - (behavior () (dummy-18 self) (none)) + (behavior () + (dummy-18 self) + (none) + ) ) ;; failed to figure out what this is: (defstate projectile-dissipate (projectile-blue) :virtual #t :code - (behavior () (go-virtual projectile-die) (none)) + (behavior () + (go-virtual projectile-die) + (none) + ) ) diff --git a/test/decompiler/reference/engine/game/settings_REF.gc b/test/decompiler/reference/engine/game/settings_REF.gc index 37939b1b6c..b4819fee1c 100644 --- a/test/decompiler/reference/engine/game/settings_REF.gc +++ b/test/decompiler/reference/engine/game/settings_REF.gc @@ -34,10 +34,9 @@ ) ) (('sfx-volume) - (when (or - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) - (= (get-process conn) (ppointer->process *progress-process*)) - ) + (when (or (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask progress))) + (= (get-process conn) (ppointer->process *progress-process*)) + ) (case (the-as symbol (-> conn param1)) (('rel) (set! (-> obj sfx-volume) (* 0.01 (the-as float (-> conn param2)) (-> obj sfx-volume))) @@ -218,10 +217,9 @@ (s4-0 (-> arg0 connection-list next1)) ) (while s4-0 - (if (and - (belongs-to-engine? (the-as connection s4-0) s5-0) - (or (= arg1 #t) (= arg1 (-> (the-as connection s4-0) param0))) - ) + (if (and (belongs-to-engine? (the-as connection s4-0) s5-0) + (or (= arg1 #t) (= arg1 (-> (the-as connection s4-0) param0))) + ) (move-to-dead (the-as connection s4-0)) ) (set! s4-0 (-> s4-0 next1)) @@ -299,10 +297,9 @@ (set! (-> gp-0 language) (-> s5-1 language)) (set-language (-> gp-0 language)) ) - (when (and - (!= (-> s5-1 music) (-> gp-0 music)) - (and (< 0.0 (-> *setting-control* current music-volume)) (zero? (rpc-busy? 1)) *sound-bank-1* *sound-bank-2*) - ) + (when (and (!= (-> s5-1 music) (-> gp-0 music)) + (and (< 0.0 (-> *setting-control* current music-volume)) (zero? (rpc-busy? 1)) *sound-bank-1* *sound-bank-2*) + ) (cond ((-> s5-1 music) (format 0 "Load music ~A~%" (-> s5-1 music)) diff --git a/test/decompiler/reference/engine/game/task/hint-control_REF.gc b/test/decompiler/reference/engine/game/task/hint-control_REF.gc index 3609428cda..06c792ecd9 100644 --- a/test/decompiler/reference/engine/game/task/hint-control_REF.gc +++ b/test/decompiler/reference/engine/game/task/hint-control_REF.gc @@ -241,11 +241,10 @@ ;; INFO: Return type mismatch int vs none. (defun start-hint-timer ((arg0 game-text-id)) (let ((v1-0 (find-hint-control-index arg0))) - (when (and - (>= v1-0 0) - (zero? (-> *game-info* hint-control v1-0 start-time)) - (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) - ) + (when (and (>= v1-0 0) + (zero? (-> *game-info* hint-control v1-0 start-time)) + (!= (-> *game-info* hint-control v1-0 num-attempts-before-playing) 1) + ) (set! (-> *game-info* hint-control v1-0 start-time) (-> *display* base-frame-counter)) 0 ) @@ -285,14 +284,13 @@ (set! v1-0 #f) 0 ) - (set! v1-0 (and - v1-0 - (not (-> *setting-control* current talking)) - (not (-> *setting-control* current spooling)) - (not (-> *setting-control* current hint)) - (not (-> *setting-control* current ambient)) - (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) - ) + (set! v1-0 (and v1-0 + (not (-> *setting-control* current talking)) + (not (-> *setting-control* current spooling)) + (not (-> *setting-control* current hint)) + (not (-> *setting-control* current ambient)) + (>= (-> *display* base-frame-counter) (-> *game-info* blackout-time)) + ) ) 0 ) @@ -312,11 +310,10 @@ (+! (-> gp-1 start-time) a0-24) ) (cond - ((and - (!= (-> gp-1 num-attempts-before-playing) 1) - (nonzero? (-> gp-1 last-time-called)) - (< (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) 150) - ) + ((and (!= (-> gp-1 num-attempts-before-playing) 1) + (nonzero? (-> gp-1 last-time-called)) + (< (- (-> *display* base-frame-counter) (-> gp-1 last-time-called)) 150) + ) (set! (-> gp-1 last-time-called) (-> *display* base-frame-counter)) #f ) @@ -331,13 +328,11 @@ (cond (v1-21 (set! (-> gp-1 num-attempts) (seekl (-> gp-1 num-attempts) 127 1)) - (and - (>= (-> gp-1 num-attempts) (-> gp-1 num-attempts-before-playing)) - (or - (= (-> gp-1 num-success-before-killing) -1) - (< (-> gp-1 num-success) (-> gp-1 num-success-before-killing)) - ) - ) + (and (>= (-> gp-1 num-attempts) (-> gp-1 num-attempts-before-playing)) + (or (= (-> gp-1 num-success-before-killing) -1) + (< (-> gp-1 num-success) (-> gp-1 num-success-before-killing)) + ) + ) ) (else #f diff --git a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc index 1b478f6098..a8e8544e6f 100644 --- a/test/decompiler/reference/engine/game/task/process-taskable_REF.gc +++ b/test/decompiler/reference/engine/game/task/process-taskable_REF.gc @@ -294,8 +294,8 @@ ;; definition for function process-taskable-anim-loop (defbehavior process-taskable-anim-loop process-taskable () (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (get-art-elem self) ) (ja-channel-push! 1 60) @@ -380,16 +380,17 @@ (defstate lose (process-taskable) :virtual #t :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1500) - (or - (not *target*) - (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1500) + (or (not *target*) + (< 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) (go-virtual idle) ) ((-> self cur-trans-hook)) @@ -563,12 +564,12 @@ ) ) (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -610,7 +611,11 @@ :exit process-taskable-play-anim-exit :trans - (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none)) + (behavior () + (process-taskable-play-anim-trans) + ((-> self cur-trans-hook)) + (none) + ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-accept-anim self #t)) @@ -632,7 +637,11 @@ :exit process-taskable-play-anim-exit :trans - (behavior () (process-taskable-play-anim-trans) ((-> self cur-trans-hook)) (none)) + (behavior () + (process-taskable-play-anim-trans) + ((-> self cur-trans-hook)) + (none) + ) :code (behavior () (process-taskable-play-anim-code (the-as art-joint-anim (get-art-elem self)) (get-reject-anim self #t)) @@ -837,7 +846,10 @@ :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit - (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) (none)) + (behavior () + (process-taskable-hide-exit (= (-> self next-state name) 'hidden)) + (none) + ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) @@ -856,10 +868,9 @@ ;; WARN: disable def twice: 4. This may happen when a cond (no else) is nested inside of another conditional, but it should be rare. (defmethod TODO-RENAME-50 process-taskable ((obj process-taskable)) (if *target* - (or - (not *target*) - (< 245760.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) - ) + (or (not *target*) + (< 245760.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + ) (< 60397978000.0 (vector-vector-distance-squared (the-as vector (-> obj root-override root-prim prim-core)) (camera-pos)) ) @@ -877,7 +888,10 @@ :enter (the-as (function none :behavior process-taskable) process-taskable-hide-enter) :exit - (behavior () (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) (none)) + (behavior () + (process-taskable-hide-exit (= (-> self next-state name) 'hidden-other)) + (none) + ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) @@ -963,7 +977,11 @@ (none) ) :trans - (behavior () (draw-npc-shadow self) ((-> self cur-trans-hook)) (none)) + (behavior () + (draw-npc-shadow self) + ((-> self cur-trans-hook)) + (none) + ) :code (behavior ((arg0 handle)) (clone-anim arg0 (-> self center-joint-index) #t "") @@ -1067,24 +1085,22 @@ ) ((begin (dummy-46 self) - (and - (not - (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) - (< (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) - 32768.0 + (and (not + (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) + (< (-> (target-pos 0) y) (+ 8192.0 (-> self root-override root-prim prim-core world-sphere y))) + (< (vector-vector-distance (target-pos 0) (the-as vector (-> self root-override root-prim prim-core))) + 32768.0 + ) + (= (-> *level* loading-level) (-> *level* level-default)) + (not (movie?)) + (not (level-hint-displayed?)) + (none-reserved? *art-control*) + (not *progress-process*) + (and (not (handle->process (-> *game-info* other-camera-handle))) (close-anim-file! self)) ) - (= (-> *level* loading-level) (-> *level* level-default)) - (not (movie?)) - (not (level-hint-displayed?)) - (none-reserved? *art-control*) - (not *progress-process*) - (and (not (handle->process (-> *game-info* other-camera-handle))) (close-anim-file! self)) - ) ) (first-any (-> self tasks) #t) (when (target-above-threshold? self) @@ -1131,11 +1147,10 @@ (dummy-33 self) ) (draw-npc-shadow self) - (when (and (-> self been-kicked) (and - (not *progress-process*) - (process-grab? *target*) - (not (handle->process (-> *game-info* other-camera-handle))) - ) + (when (and (-> self been-kicked) (and (not *progress-process*) + (process-grab? *target*) + (not (handle->process (-> *game-info* other-camera-handle))) + ) ) (set! (-> self been-kicked) #f) (send-event *target* 'trans 'save (-> self old-target-pos)) @@ -1287,12 +1302,11 @@ ;; definition for method 11 of type ambient-control (defmethod play-ambient ambient-control ((obj ambient-control) (arg0 string) (arg1 symbol) (arg2 vector)) - (when (and - (not (string= arg0 (-> obj last-ambient))) - (or arg1 (can-hint-be-played? (game-text-id one) (the-as entity #f) (the-as string #f))) - (= (-> *level* loading-level) (-> *level* level-default)) - (ambient-hint-spawn arg0 arg2 *entity-pool* 'ambient) - ) + (when (and (not (string= arg0 (-> obj last-ambient))) + (or arg1 (can-hint-be-played? (game-text-id one) (the-as entity #f) (the-as string #f))) + (= (-> *level* loading-level) (-> *level* level-default)) + (ambient-hint-spawn arg0 arg2 *entity-pool* 'ambient) + ) (set! (-> obj last-ambient-time) (-> *display* game-frame-counter)) (set! (-> obj last-ambient) arg0) (return #t) @@ -1334,13 +1348,12 @@ ) (cond ((t9-0 (rtype-of v1-1) string) - (let ((v1-8 - (dummy-10 - (-> (the-as process-taskable (-> self hand process 0)) draw jgeo) - (the-as string (-> arg3 param 0)) - (the-as type #f) - ) - ) + (let ((v1-8 (dummy-10 + (-> (the-as process-taskable (-> self hand process 0)) draw jgeo) + (the-as string (-> arg3 param 0)) + (the-as type #f) + ) + ) ) (when v1-8 (set! v0-0 (+ (-> v1-8 number) 1)) @@ -1445,13 +1458,11 @@ (let ((a0-25 (-> self hand process 0))) (when (or (-> self die?) (and (not (-> self survive-anim-end?)) (ja-anim-done? a0-25))) (let ((gp-1 (-> *display* base-frame-counter))) - (while (and - (< (- (-> *display* base-frame-counter) gp-1) #x4650) - (or - (and (-> self entity) (not (is-object-visible? (-> self entity extra level) (-> self entity extra vis-id)))) - (< 81920.0 (vector-vector-distance (camera-pos) (-> *math-camera* trans))) - ) - ) + (while (and (< (- (-> *display* base-frame-counter) gp-1) #x4650) + (or (and (-> self entity) (not (is-object-visible? (-> self entity extra level) (-> self entity extra vis-id)))) + (< 81920.0 (vector-vector-distance (camera-pos) (-> *math-camera* trans))) + ) + ) (suspend) ) ) diff --git a/test/decompiler/reference/engine/game/task/task-control_REF.gc b/test/decompiler/reference/engine/game/task/task-control_REF.gc index 1dc8190b97..82cb6e0a59 100644 --- a/test/decompiler/reference/engine/game/task/task-control_REF.gc +++ b/test/decompiler/reference/engine/game/task/task-control_REF.gc @@ -209,9 +209,9 @@ ) (dotimes (s4-0 (-> obj stage length)) (if (or (= arg0 'game) (let ((a0-4 (-> obj stage s4-0))) - (not (logtest? (-> a0-4 flags) (task-flags closed-by-default))) - ) - ) + (not (logtest? (-> a0-4 flags) (task-flags closed-by-default))) + ) + ) (open-task! (-> obj stage s4-0)) ) (let ((a0-10 (-> obj stage s4-0))) @@ -315,20 +315,18 @@ :condition (lambda ((arg0 task-control)) (with-pp - (or - (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) - (and - (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) + (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) pp) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'pickup)) + (set! (-> a1-2 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -340,20 +338,18 @@ :condition (lambda ((arg0 task-control)) (with-pp - (or - (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) - (and - (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) pp) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'pickup)) - (set! (-> a1-2 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task jungle-eggtop) (task-status need-reminder)) + (and (closed? arg0 (game-task jungle-eggtop) (task-status need-introduction)) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) pp) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'pickup)) + (set! (-> a1-2 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-2)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -482,23 +478,20 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (and - (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or - (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and - (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) - ) - ) - ) - ) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'query) + (set! (-> a1-4 param 0) (the-as uint 'pickup)) + (set! (-> a1-4 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + ) + ) + ) + ) ) ) ) @@ -510,23 +503,20 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (and - (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or - (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and - (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) - ) - ) - ) - ) + (and (task-closed? (game-task beach-flutflut) (task-status need-reminder)) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'query) + (set! (-> a1-4 param 0) (the-as uint 'pickup)) + (set! (-> a1-4 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + ) + ) + ) + ) ) ) ) @@ -539,34 +529,30 @@ (lambda ((arg0 task-control) (arg1 task-control)) (with-pp (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or - (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and - (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'query) + (set! (-> a1-4 param 0) (the-as uint 'pickup)) + (set! (-> a1-4 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) - (or - (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and - (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) pp) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'query) + (set! (-> a1-8 param 0) (the-as uint 'pickup)) + (set! (-> a1-8 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -580,34 +566,30 @@ (lambda ((arg0 task-control) (arg1 task-control)) (with-pp (if (task-closed? (game-task beach-flutflut) (task-status need-reminder)) - (or - (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) - (and - (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) - (let ((a1-4 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-4 from) pp) - (set! (-> a1-4 num-params) 2) - (set! (-> a1-4 message) 'query) - (set! (-> a1-4 param 0) (the-as uint 'pickup)) - (set! (-> a1-4 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task swamp-flutflut) (task-status need-reminder)) + (and (closed? arg0 (game-task swamp-flutflut) (task-status need-introduction)) + (let ((a1-4 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-4 from) pp) + (set! (-> a1-4 num-params) 2) + (set! (-> a1-4 message) 'query) + (set! (-> a1-4 param 0) (the-as uint 'pickup)) + (set! (-> a1-4 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-4)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) - (or - (closed? arg0 (game-task sunken-room) (task-status need-reminder)) - (and - (closed? arg0 (game-task sunken-room) (task-status need-introduction)) - (let ((a1-8 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-8 from) pp) - (set! (-> a1-8 num-params) 2) - (set! (-> a1-8 message) 'query) - (set! (-> a1-8 param 0) (the-as uint 'pickup)) - (set! (-> a1-8 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task sunken-room) (task-status need-reminder)) + (and (closed? arg0 (game-task sunken-room) (task-status need-introduction)) + (let ((a1-8 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-8 from) pp) + (set! (-> a1-8 num-params) 2) + (set! (-> a1-8 message) 'query) + (set! (-> a1-8 param 0) (the-as uint 'pickup)) + (set! (-> a1-8 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-8)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -750,19 +732,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -862,19 +843,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -974,19 +954,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -1071,20 +1050,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and - (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1096,20 +1073,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) - (and - (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task beach-ecorocks) (task-status need-reminder)) + (and (closed? arg0 (game-task beach-ecorocks) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1189,20 +1164,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and - (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1214,20 +1187,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) - (and - (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task rolling-plants) (task-status need-reminder)) + (and (closed? arg0 (game-task rolling-plants) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1312,19 +1283,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1349,19 +1319,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1428,19 +1397,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1465,19 +1433,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1544,19 +1511,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1581,19 +1547,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-oracle-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-oracle-inc) + ) + ) + ) ) ) ) @@ -1688,19 +1653,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -1714,19 +1678,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -1740,19 +1703,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -1766,19 +1728,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -1791,20 +1752,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and - (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1816,20 +1775,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) - (and - (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task village3-miner-money4) (task-status need-reminder)) + (and (closed? arg0 (game-task village3-miner-money4) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1841,20 +1798,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and - (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -1866,20 +1821,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) - (and - (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task cave-gnawers) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-gnawers) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -2041,20 +1994,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and - (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -2066,20 +2017,18 @@ :condition (lambda ((arg0 task-control) (arg1 task-control)) (with-pp - (or - (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) - (and - (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) - (let ((a1-3 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-3 from) pp) - (set! (-> a1-3 num-params) 2) - (set! (-> a1-3 message) 'query) - (set! (-> a1-3 param 0) (the-as uint 'pickup)) - (set! (-> a1-3 param 1) (the-as uint 6)) - (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) - ) + (or (closed? arg0 (game-task cave-dark-crystals) (task-status need-reminder)) + (and (closed? arg0 (game-task cave-dark-crystals) (task-status need-introduction)) + (let ((a1-3 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-3 from) pp) + (set! (-> a1-3 num-params) 2) + (set! (-> a1-3 message) 'query) + (set! (-> a1-3 param 0) (the-as uint 'pickup)) + (set! (-> a1-3 param 1) (the-as uint 6)) + (>= (the int (send-event-function *target* a1-3)) (+ (get-reminder arg0 1) 3)) + ) + ) ) - ) ) ) ) @@ -2527,19 +2476,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) @@ -3045,10 +2993,9 @@ (task-flags has-entity closed-by-default) :condition (lambda ((arg0 task-control)) - (and - (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) - ) + (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) + (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) + ) ) ) (new 'static 'task-cstage @@ -3058,10 +3005,9 @@ (task-flags has-entity closed-by-default) :condition (lambda ((arg0 task-control)) - (and - (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) - (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) - ) + (and (not (task-closed? (game-task ogre-boss) (task-status need-reminder))) + (not (task-closed? (game-task village2-levitator) (task-status need-reward-speech))) + ) ) ) (new 'static 'task-cstage @@ -3073,19 +3019,18 @@ (with-pp (the-as symbol - (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) pp) - (set! (-> a1-0 num-params) 2) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'pickup)) - (set! (-> a1-0 param 1) (the-as uint 5)) - (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) - (-> *GAME-bank* money-task-inc) - ) - ) - ) + (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) pp) + (set! (-> a1-0 num-params) 2) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'pickup)) + (set! (-> a1-0 param 1) (the-as uint 5)) + (>= ((the-as (function process event-message-block float) send-event-function) *target* a1-0) + (-> *GAME-bank* money-task-inc) + ) + ) + ) ) ) ) diff --git a/test/decompiler/reference/engine/game/voicebox_REF.gc b/test/decompiler/reference/engine/game/voicebox_REF.gc index d2f6dbe4e9..3ef78cb0f4 100644 --- a/test/decompiler/reference/engine/game/voicebox_REF.gc +++ b/test/decompiler/reference/engine/game/voicebox_REF.gc @@ -82,10 +82,9 @@ ) (vector-lerp! (-> self root trans) gp-0 s5-0 (-> self blend)) ) - (+! - (-> self root trans y) - (* 1638.4 (sin (* 54.613335 (the float (mod (-> *display* base-frame-counter) 1200))))) - ) + (+! (-> self root trans y) + (* 1638.4 (sin (* 54.613335 (the float (mod (-> *display* base-frame-counter) 1200))))) + ) (let ((gp-1 (new 'stack-no-clear 'quaternion))) (forward-up->quaternion gp-1 @@ -135,12 +134,13 @@ (defstate enter (voicebox) :virtual #t :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('die) - (go-virtual exit) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go-virtual exit) + ) + ) + ) :trans (behavior () (voicebox-track) @@ -213,11 +213,10 @@ (clear-pending-settings-from-process *setting-control* self 'sound-flava) (set! (-> self state-time) (-> *display* base-frame-counter)) (set! (-> self seeker target) 1.0) - (while (and (< (-> self blend) 0.9999) (not (and - (not (handle->process (-> self hint))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) - (-> *setting-control* current hint) - ) + (while (and (< (-> self blend) 0.9999) (not (and (not (handle->process (-> self hint))) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) + (-> *setting-control* current hint) + ) ) ) (update! (-> self seeker) 0.0) diff --git a/test/decompiler/reference/engine/geometry/bounding-box_REF.gc b/test/decompiler/reference/engine/geometry/bounding-box_REF.gc index a408f00a04..7c782b45ed 100644 --- a/test/decompiler/reference/engine/geometry/bounding-box_REF.gc +++ b/test/decompiler/reference/engine/geometry/bounding-box_REF.gc @@ -3,26 +3,24 @@ ;; definition for function box-vector-enside? (defun box-vector-enside? ((box bounding-box) (pt vector)) - (and - (< (-> box min x) (-> pt x)) - (< (-> box min y) (-> pt y)) - (< (-> box min z) (-> pt z)) - (< (-> pt x) (-> box max x)) - (< (-> pt y) (-> box max y)) - (< (-> pt z) (-> box max z)) - ) + (and (< (-> box min x) (-> pt x)) + (< (-> box min y) (-> pt y)) + (< (-> box min z) (-> pt z)) + (< (-> pt x) (-> box max x)) + (< (-> pt y) (-> box max y)) + (< (-> pt z) (-> box max z)) + ) ) ;; definition for function box-vector-inside? (defun box-vector-inside? ((box bounding-box) (pt vector)) - (and - (>= (-> pt x) (-> box min x)) - (>= (-> pt y) (-> box min y)) - (>= (-> pt z) (-> box min z)) - (>= (-> box max x) (-> pt x)) - (>= (-> box max y) (-> pt y)) - (>= (-> box max z) (-> pt z)) - ) + (and (>= (-> pt x) (-> box min x)) + (>= (-> pt y) (-> box min y)) + (>= (-> pt z) (-> box min z)) + (>= (-> box max x) (-> pt x)) + (>= (-> box max y) (-> pt y)) + (>= (-> box max z) (-> pt z)) + ) ) ;; definition for method 11 of type bounding-box diff --git a/test/decompiler/reference/engine/geometry/geometry_REF.gc b/test/decompiler/reference/engine/geometry/geometry_REF.gc index bd67035324..800c1c1263 100644 --- a/test/decompiler/reference/engine/geometry/geometry_REF.gc +++ b/test/decompiler/reference/engine/geometry/geometry_REF.gc @@ -1219,9 +1219,9 @@ ) ) (+ (if (< f22-0 f20-0) - f26-0 - f24-0 - ) + f26-0 + f24-0 + ) (/ gp-0 f30-0) ) ) diff --git a/test/decompiler/reference/engine/gfx/background_REF.gc b/test/decompiler/reference/engine/gfx/background_REF.gc index f559ad2c0f..ddaf51678e 100644 --- a/test/decompiler/reference/engine/gfx/background_REF.gc +++ b/test/decompiler/reference/engine/gfx/background_REF.gc @@ -134,14 +134,13 @@ ) ) (let ((gp-1 (the-as level #f))) - (when (or - (nonzero? (-> *background-work* tfrag-tree-count)) - (nonzero? (-> *background-work* trans-tfrag-tree-count)) - (nonzero? (-> *background-work* dirt-tfrag-tree-count)) - (nonzero? (-> *background-work* ice-tfrag-tree-count)) - (nonzero? (-> *background-work* lowres-tfrag-tree-count)) - (nonzero? (-> *background-work* lowres-trans-tfrag-tree-count)) - ) + (when (or (nonzero? (-> *background-work* tfrag-tree-count)) + (nonzero? (-> *background-work* trans-tfrag-tree-count)) + (nonzero? (-> *background-work* dirt-tfrag-tree-count)) + (nonzero? (-> *background-work* ice-tfrag-tree-count)) + (nonzero? (-> *background-work* lowres-tfrag-tree-count)) + (nonzero? (-> *background-work* lowres-trans-tfrag-tree-count)) + ) (let ((v1-48 *math-camera*)) (.lvf vf16 (&-> v1-48 plane 0 quad)) (.lvf vf17 (&-> v1-48 plane 1 quad)) diff --git a/test/decompiler/reference/engine/gfx/depth-cue_REF.gc b/test/decompiler/reference/engine/gfx/depth-cue_REF.gc index 134a4e9840..d05494f760 100644 --- a/test/decompiler/reference/engine/gfx/depth-cue_REF.gc +++ b/test/decompiler/reference/engine/gfx/depth-cue_REF.gc @@ -423,8 +423,8 @@ ;; definition for function depth-cue-calc-z (defun depth-cue-calc-z ((arg0 float)) (+ (* (+ (* arg0 (-> *math-camera* perspective vector 2 z)) (-> *math-camera* perspective vector 3 z)) - (/ (-> *math-camera* d) arg0) - ) + (/ (-> *math-camera* d) arg0) + ) (-> *math-camera* hvdf-off z) ) ) @@ -570,10 +570,9 @@ (set! (-> v1-27 length) (max 84 (-> v1-27 length))) (set! (-> v1-27 data 83 name) "depth-cue") (+! (-> v1-27 data 83 count) 1) - (+! - (-> v1-27 data 83 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint gp-0)) - ) + (+! (-> v1-27 data 83 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint gp-0)) + ) (set! (-> v1-27 data 83 total) (-> v1-27 data 83 used)) ) ) @@ -583,7 +582,3 @@ ) ) ) - - - - diff --git a/test/decompiler/reference/engine/gfx/hw/display_REF.gc b/test/decompiler/reference/engine/gfx/hw/display_REF.gc index 6e3770c44b..44d0d4c1f4 100644 --- a/test/decompiler/reference/engine/gfx/hw/display_REF.gc +++ b/test/decompiler/reference/engine/gfx/hw/display_REF.gc @@ -323,10 +323,9 @@ (+! block-idx 1) ) ) - (when (or - (< 75 (- (-> *display* real-frame-counter) (the-as int (-> obj cache-time)))) - (>= end-time (the-as int (-> worst-time-cache (/ bar-pos 10)))) - ) + (when (or (< 75 (- (-> *display* real-frame-counter) (the-as int (-> obj cache-time)))) + (>= end-time (the-as int (-> worst-time-cache (/ bar-pos 10)))) + ) (set! (-> worst-time-cache (/ bar-pos 10)) (the-as uint end-time)) (set! (-> obj cache-time) (the-as uint (-> *display* real-frame-counter))) ) diff --git a/test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc b/test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc index c4e08a639c..fe3b6bee49 100644 --- a/test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc +++ b/test/decompiler/reference/engine/gfx/ocean/ocean-transition_REF.gc @@ -30,12 +30,11 @@ (a0-4 (- arg1 (the-as int (* (-> *ocean-work* mid-minx) 4)))) ) (cond - ((or - (< (the-as uint v1-3) 0) - (>= (the-as uint v1-3) (the-as uint 16)) - (< (the-as uint a0-4) 0) - (>= (the-as uint a0-4) (the-as uint 16)) - ) + ((or (< (the-as uint v1-3) 0) + (>= (the-as uint v1-3) (the-as uint 16)) + (< (the-as uint a0-4) 0) + (>= (the-as uint a0-4) (the-as uint 16)) + ) #f ) (else @@ -61,12 +60,11 @@ (a0-4 (- arg1 (the-as int (* (-> *ocean-work* mid-minx) 4)))) ) (cond - ((or - (< (the-as uint v1-3) 0) - (>= (the-as uint v1-3) (the-as uint 16)) - (< (the-as uint a0-4) 0) - (>= (the-as uint a0-4) (the-as uint 16)) - ) + ((or (< (the-as uint v1-3) 0) + (>= (the-as uint v1-3) (the-as uint 16)) + (< (the-as uint a0-4) 0) + (>= (the-as uint a0-4) (the-as uint 16)) + ) #f ) (else diff --git a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc index 7253a21e39..0eb620252f 100644 --- a/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc +++ b/test/decompiler/reference/engine/gfx/shadow/shadow_REF.gc @@ -146,13 +146,12 @@ ;; INFO: Return type mismatch int vs none. ;; Used lq/sq (defbehavior do-target-shadow target () - (if (and - (logtest? (-> self control status) 1) - (!= (-> self control unknown-surface00 mode) 'swim) - (!= (-> self control unknown-surface00 mode) 'dive) - (!= (-> self next-state name) 'target-flop) - (zero? (logand (-> self draw status) (draw-status drwf01 drwf02 drwf05))) - ) + (if (and (logtest? (-> self control status) 1) + (!= (-> self control unknown-surface00 mode) 'swim) + (!= (-> self control unknown-surface00 mode) 'dive) + (!= (-> self next-state name) 'target-flop) + (zero? (logand (-> self draw status) (draw-status drwf01 drwf02 drwf05))) + ) (set! (-> self control shadow-pos quad) (-> self control trans quad)) (find-ground-and-draw-shadow (-> self control trans) diff --git a/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc b/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc index c49711b886..719b5f5cc7 100644 --- a/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc +++ b/test/decompiler/reference/engine/gfx/sky/sky-tng_REF.gc @@ -851,10 +851,9 @@ (set! (-> v1-101 length) (max 86 (-> v1-101 length))) (set! (-> v1-101 data 85 name) "sky") (+! (-> v1-101 data 85 count) 1) - (+! - (-> v1-101 data 85 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint gp-0)) - ) + (+! (-> v1-101 data 85 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint gp-0)) + ) (set! (-> v1-101 data 85 total) (-> v1-101 data 85 used)) ) ) diff --git a/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher_REF.gc b/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher_REF.gc index ba66df6ff4..e04750fba6 100644 --- a/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher_REF.gc +++ b/test/decompiler/reference/engine/gfx/sparticle/sparticle-launcher_REF.gc @@ -731,10 +731,9 @@ ) (set! (-> arg2 next-launcher) (the-as basic 0)) (cond - ((and - (logtest? (-> arg2 flags) (sp-cpuinfo-flag bit12)) - (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag aux-list))) - ) + ((and (logtest? (-> arg2 flags) (sp-cpuinfo-flag bit12)) + (zero? (logand (-> arg2 flags) (sp-cpuinfo-flag aux-list))) + ) (let ((f20-0 (-> arg3 r-g-b-a x)) (f22-0 (-> arg3 r-g-b-a y)) (f24-0 (-> arg3 r-g-b-a z)) diff --git a/test/decompiler/reference/engine/gfx/sprite/sprite_REF.gc b/test/decompiler/reference/engine/gfx/sprite/sprite_REF.gc index 9cdace169e..55a32c1f01 100644 --- a/test/decompiler/reference/engine/gfx/sprite/sprite_REF.gc +++ b/test/decompiler/reference/engine/gfx/sprite/sprite_REF.gc @@ -950,10 +950,9 @@ (set! (-> mem-use length) (max 83 (-> mem-use length))) (set! (-> mem-use data 82 name) "sprite") (+! (-> mem-use data 82 count) 1) - (+! - (-> mem-use data 82 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint dma-mem-begin)) - ) + (+! (-> mem-use data 82 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint dma-mem-begin)) + ) (set! (-> mem-use data 82 total) (-> mem-use data 82 used)) ) ) diff --git a/test/decompiler/reference/engine/gfx/texture_REF.gc b/test/decompiler/reference/engine/gfx/texture_REF.gc index b28f586fc2..40ad50a231 100644 --- a/test/decompiler/reference/engine/gfx/texture_REF.gc +++ b/test/decompiler/reference/engine/gfx/texture_REF.gc @@ -1460,25 +1460,22 @@ (when tfrag-page (set! (-> level upload-size 0) 0) (if (< distance 81920.0) - (+! - (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-near) tfrag-page 2 (the-as bucket-id tfrag-bucket)) - ) + (+! (-> level upload-size 0) + (upload-vram-pages obj (-> obj segment-near) tfrag-page 2 (the-as bucket-id tfrag-bucket)) + ) ) (cond ((= distance 4095996000.0) ) ((< 102400.0 distance) - (+! - (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page 0 (the-as bucket-id tfrag-bucket)) - ) + (+! (-> level upload-size 0) + (upload-vram-pages obj (-> obj segment-common) tfrag-page 0 (the-as bucket-id tfrag-bucket)) + ) ) (else - (+! - (-> level upload-size 0) - (upload-vram-pages obj (-> obj segment-common) tfrag-page -2 (the-as bucket-id tfrag-bucket)) - ) + (+! (-> level upload-size 0) + (upload-vram-pages obj (-> obj segment-common) tfrag-page -2 (the-as bucket-id tfrag-bucket)) + ) ) ) ) @@ -2286,11 +2283,10 @@ (dma-buffer-send-chain (the-as dma-bank-source #x10009000) dma-buff) ) (dma-sync (the-as pointer #x10009000) 0 0) - (if (and - main-font-tx - (-> main-font-tx page) - (= (-> obj cur) (+ heap-before-font-tex (-> main-font-tx page size))) - ) + (if (and main-font-tx + (-> main-font-tx page) + (= (-> obj cur) (+ heap-before-font-tex (-> main-font-tx page size))) + ) (set! (-> obj cur) heap-before-font-tex) (format 0 "ERROR: could not resize heap to remove gamefont.~%") ) @@ -2338,10 +2334,10 @@ (t5-0 num-mips) ) (if (= seg-id (if (>= (the-as uint 2) t5-0) - (+ (- -1 t4-0) t5-0) - (max 0 (- 2 t4-0)) - ) - ) + (+ (- -1 t4-0) t5-0) + (max 0 (- 2 t4-0)) + ) + ) (set! (-> tex dest mip-id) (+ (- (-> tex dest mip-id) dst-block) v1-0)) ) ) diff --git a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc index ee140a0cc6..06ba3c8a1a 100644 --- a/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc +++ b/test/decompiler/reference/engine/gfx/tfrag/tfrag-methods_REF.gc @@ -237,10 +237,9 @@ (set! (-> v1-69 length) (max 2 (-> v1-69 length))) (set! (-> v1-69 data 1 name) "tfragment") (+! (-> v1-69 data 1 count) 1) - (+! - (-> v1-69 data 1 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s5-1)) - ) + (+! (-> v1-69 data 1 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s5-1)) + ) (set! (-> v1-69 data 1 total) (-> v1-69 data 1 used)) ) ) diff --git a/test/decompiler/reference/engine/gfx/tfrag/tfrag_REF.gc b/test/decompiler/reference/engine/gfx/tfrag/tfrag_REF.gc index 81f3147de2..13b05191d8 100644 --- a/test/decompiler/reference/engine/gfx/tfrag/tfrag_REF.gc +++ b/test/decompiler/reference/engine/gfx/tfrag/tfrag_REF.gc @@ -49,20 +49,19 @@ ) ) (set! (-> arg0 data (+ s4-0 4) name) "tfragment-level1") - (when (not (or - (= (-> obj dma-level-1) (-> obj dma-common)) - (= (-> obj dma-level-1) (-> obj dma-base)) - (zero? (-> obj num-level1-colors)) - ) + (when (not (or (= (-> obj dma-level-1) (-> obj dma-common)) + (= (-> obj dma-level-1) (-> obj dma-base)) + (zero? (-> obj num-level1-colors)) + ) ) (+! (-> arg0 data (+ s4-0 4) count) 1) (let ((v1-70 (* (- (-> obj dma-qwc 3) - (the-as - uint - (- (/ (the-as int (- (-> obj dma-level-1) (-> obj dma-common))) 16) (the-as int (-> obj dma-qwc 0))) - ) - ) + (the-as + uint + (- (/ (the-as int (- (-> obj dma-level-1) (-> obj dma-common))) 16) (the-as int (-> obj dma-qwc 0))) + ) + ) 16 ) ) diff --git a/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc b/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc index 1dafcb768b..c918adc0ac 100644 --- a/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/tie-methods_REF.gc @@ -421,10 +421,9 @@ (set! (-> a0-38 length) (max 10 (-> a0-38 length))) (set! (-> a0-38 data 9 name) "tie-fragment") (+! (-> a0-38 data 9 count) 1) - (+! - (-> a0-38 data 9 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-0)) - ) + (+! (-> a0-38 data 9 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-0)) + ) (set! (-> a0-38 data 9 total) (-> a0-38 data 9 used)) ) ) @@ -477,10 +476,9 @@ (set! (-> a0-51 length) (max 18 (-> a0-51 length))) (set! (-> a0-51 data 17 name) "tie-generic") (+! (-> a0-51 data 17 count) 1) - (+! - (-> a0-51 data 17 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-1)) - ) + (+! (-> a0-51 data 17 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s2-1)) + ) (set! (-> a0-51 data 17 total) (-> a0-51 data 17 used)) ) ) @@ -557,10 +555,9 @@ (set! (-> v1-100 length) (max 10 (-> v1-100 length))) (set! (-> v1-100 data 9 name) "tie-fragment") (+! (-> v1-100 data 9 count) 1) - (+! - (-> v1-100 data 9 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-2)) - ) + (+! (-> v1-100 data 9 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-2)) + ) (set! (-> v1-100 data 9 total) (-> v1-100 data 9 used)) ) ) @@ -634,10 +631,9 @@ (set! (-> a0-92 length) (max 16 (-> a0-92 length))) (set! (-> a0-92 data 15 name) "tie-near") (+! (-> a0-92 data 15 count) 1) - (+! - (-> a0-92 data 15 used) - (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3)) - ) + (+! (-> a0-92 data 15 used) + (&- (-> *display* frames (-> *display* on-screen) frame global-buf base) (the-as uint s3-3)) + ) (set! (-> a0-92 data 15 total) (-> a0-92 data 15 used)) ) ) diff --git a/test/decompiler/reference/engine/gfx/tie/tie_REF.gc b/test/decompiler/reference/engine/gfx/tie/tie_REF.gc index b7a6d433fd..e27647d6a7 100644 --- a/test/decompiler/reference/engine/gfx/tie/tie_REF.gc +++ b/test/decompiler/reference/engine/gfx/tie/tie_REF.gc @@ -178,26 +178,24 @@ (a1-2 arg0) (v1-29 s2-0) ) - (t9-1 a0-10 a1-2 (logior - (logior - (cond - ((= v1-29 1) - 4 - ) - ((= v1-29 2) - 8 - ) - ((= v1-29 3) - 16 - ) - (else - 0 + (t9-1 a0-10 a1-2 (logior (logior (cond + ((= v1-29 1) + 4 + ) + ((= v1-29 2) + 8 + ) + ((= v1-29 3) + 16 + ) + (else + 0 + ) + ) + 2 + ) + arg1 ) - ) - 2 - ) - arg1 - ) ) ) ) @@ -748,7 +746,3 @@ ) (none) ) - - - - diff --git a/test/decompiler/reference/engine/gfx/time-of-day_REF.gc b/test/decompiler/reference/engine/gfx/time-of-day_REF.gc index e589cfc6cd..90f83efea3 100644 --- a/test/decompiler/reference/engine/gfx/time-of-day_REF.gc +++ b/test/decompiler/reference/engine/gfx/time-of-day_REF.gc @@ -17,10 +17,9 @@ (defbehavior time-of-day-update time-of-day-proc () (time-of-day-effect) (cond - ((and - (or (>= (-> self hour) 19) (>= 5 (-> self hour))) - (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) - ) + ((and (or (>= (-> self hour) 19) (>= 5 (-> self hour))) + (and (< 45.0 (-> *time-of-day-context* num-stars)) (-> *time-of-day-context* sky)) + ) (when (and *dproc* (< (-> self star-count) (the int (-> *time-of-day-context* num-stars)))) (spawn (-> self stars) (math-camera-pos)) (+! (-> self star-count) 1) @@ -44,11 +43,10 @@ ) ) (cond - ((and - (>= (-> self time-of-day) 6.25) - (< (-> self time-of-day) 18.75) - (!= (-> *time-of-day-context* sun-fade) 0.0) - ) + ((and (>= (-> self time-of-day) 6.25) + (< (-> self time-of-day) 18.75) + (!= (-> *time-of-day-context* sun-fade) 0.0) + ) (when (and *dproc* (zero? (-> self sun-count))) (spawn (-> self sun) (math-camera-pos)) (+! (-> self sun-count) 1) @@ -61,10 +59,9 @@ ) ) (cond - ((and - (or (>= (-> self time-of-day) 21.75) (>= 10.25 (-> self time-of-day))) - (!= (-> *time-of-day-context* sun-fade) 0.0) - ) + ((and (or (>= (-> self time-of-day) 21.75) (>= 10.25 (-> self time-of-day))) + (!= (-> *time-of-day-context* sun-fade) 0.0) + ) (when (and *dproc* (zero? (-> self green-sun-count))) (spawn (-> self green-sun) (math-camera-pos)) (+! (-> self green-sun-count) 1) @@ -309,18 +306,16 @@ ((= f0-6 f1-0) 0.5 ) - ((and - (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'village2) - (= (-> *level* level1 name) 'sunken) - ) + ((and (< 0.0 (-> *math-camera* trans y)) + (= (-> *level* level0 name) 'village2) + (= (-> *level* level1 name) 'sunken) + ) 0.0 ) - ((and - (< 0.0 (-> *math-camera* trans y)) - (= (-> *level* level0 name) 'sunken) - (= (-> *level* level1 name) 'village2) - ) + ((and (< 0.0 (-> *math-camera* trans y)) + (= (-> *level* level0 name) 'sunken) + (= (-> *level* level1 name) 'village2) + ) 1.0 ) (else diff --git a/test/decompiler/reference/engine/gfx/water/water_REF.gc b/test/decompiler/reference/engine/gfx/water/water_REF.gc index f393e2829a..08a9e02bf4 100644 --- a/test/decompiler/reference/engine/gfx/water/water_REF.gc +++ b/test/decompiler/reference/engine/gfx/water/water_REF.gc @@ -866,10 +866,9 @@ (set! (-> obj flags) (logand -31745 (-> obj flags))) (set! (-> obj bob-offset) (update! (-> obj bob))) (cond - ((and - (logtest? (-> obj flags) 256) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512)) - ) + ((and (logtest? (-> obj flags) 256) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512)) + ) (set! (-> obj real-ocean-offset) (- (ocean-get-height (the-as vector (-> obj bottom))) (-> obj base-height))) (if (zero? (logand (-> obj flags) 512)) (set! (-> obj ocean-offset) (-> obj real-ocean-offset)) @@ -921,12 +920,11 @@ (set! (-> s4-0 quad) (-> obj bottom 0 quad)) (vector-xz-length (-> obj process root transv)) (set! (-> s4-0 y) (-> obj surface-height)) - (when (and - (logtest? (-> obj process draw status) (draw-status drwf03)) - (zero? (-> obj process draw cur-lod)) - (logtest? #x400000 (-> obj flags)) - (logtest? #x800000 (-> obj flags)) - ) + (when (and (logtest? (-> obj process draw status) (draw-status drwf03)) + (zero? (-> obj process draw cur-lod)) + (logtest? #x400000 (-> obj flags)) + (logtest? #x800000 (-> obj flags)) + ) (let ((f30-1 (y-angle (-> obj process root))) (f28-0 (vector-xz-length (-> obj process root transv))) ) @@ -990,12 +988,12 @@ (set! (-> *part-id-table* 110 init-specs 16 initial-valuef) (-> obj surface-height)) (set! (-> *part-id-table* 110 init-specs 1 initial-valuef) (+ (lerp-scale - 12.0 - 0.4 - (the float (- (-> *display* base-frame-counter) (the-as int (-> obj enter-water-time)))) - 0.0 - 600.0 - ) + 12.0 + 0.4 + (the float (- (-> *display* base-frame-counter) (the-as int (-> obj enter-water-time)))) + 0.0 + 600.0 + ) (* 0.00012207031 (vector-xz-length (-> obj process root transv))) ) ) @@ -1032,34 +1030,29 @@ (and v1-146 (< (- (-> *display* base-frame-counter) (-> (the-as control-info v1-146) unknown-dword11)) 150)) ) ) - (if (and - (logtest? (-> obj flags) 16) - (and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024))) - ) + (if (and (logtest? (-> obj flags) 16) + (and s4-3 (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1024))) + ) (set! (-> obj bob amp) (* 0.8 (-> obj bob amp))) ) (cond - ((and - (logtest? (-> obj flags) 8) - (or - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) - (>= f30-3 (-> obj bottom 0 y)) - (and - (logtest? s5-0 2048) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1)) - (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) - ) - ) - (or - (logtest? s5-0 2048) - (< 12288.0 (vector-xz-length (-> obj process root transv))) - (< (+ (-> *display* base-frame-counter) -60) (the-as int (-> obj enter-water-time))) - (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) - (-> obj bottom 0 y) - ) - ) - ) + ((and (logtest? (-> obj flags) 8) + (or (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1024) + (>= f30-3 (-> obj bottom 0 y)) + (and (logtest? s5-0 2048) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) status) 1)) + (>= (+ 204.8 f30-3) (-> obj bottom 0 y)) + ) + ) + (or (logtest? s5-0 2048) + (< 12288.0 (vector-xz-length (-> obj process root transv))) + (< (+ (-> *display* base-frame-counter) -60) (the-as int (-> obj enter-water-time))) + (>= (+ (- 204.8 (fmin 6144.0 (+ (-> obj ocean-offset) (-> obj bob-offset) (-> obj align-offset)))) f30-3) + (-> obj bottom 0 y) + ) + ) + ) (set! (-> obj swim-time) (the-as uint (-> *display* base-frame-counter))) (send-event (-> obj process) 'swim) (logior! (-> obj flags) 2048) @@ -1067,20 +1060,18 @@ (set! (-> obj enter-swim-time) (the-as uint (-> *display* base-frame-counter))) ) (cond - ((and - (logtest? (-> obj flags) 16) - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) - (zero? (logand #x10000 (-> obj flags))) - ) + ((and (logtest? (-> obj flags) 16) + (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 4) + (zero? (logand #x10000 (-> obj flags))) + ) (let ((v1-200 (new 'stack-no-clear 'vector))) (set! (-> v1-200 quad) (-> obj bottom 0 quad)) (set! (-> v1-200 y) (- (-> obj height) (-> obj swim-height))) (let ((s4-4 (-> obj process root))) - (when (and - (zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096)) - (logtest? (-> obj flags) 2048) - (zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) 512)) - ) + (when (and (zero? (logand (-> (the-as collide-shape-moving s4-4) status) 4096)) + (logtest? (-> obj flags) 2048) + (zero? (logand (-> (the-as collide-shape-moving s4-4) root-prim prim-core action) 512)) + ) (let ((a1-27 (vector-! (new 'stack-no-clear 'vector) v1-200 (-> s4-4 trans)))) (vector-float*! a1-27 a1-27 (-> *display* frames-per-second)) (dummy-37 (the-as collide-shape-moving s4-4) a1-27) @@ -1096,14 +1087,12 @@ ) ) ((begin - (set! s4-3 (and - (logtest? (-> obj flags) 4) - (or - (not (!= (-> obj bob amp) 0.0)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj swim-time))) 15) - ) - (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3) - ) + (set! s4-3 (and (logtest? (-> obj flags) 4) + (or (not (!= (-> obj bob amp) 0.0)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> obj swim-time))) 15) + ) + (and (>= (- (-> obj height) (-> obj wade-height)) (-> obj bottom 0 y)) s4-3) + ) ) s4-3 ) @@ -1113,11 +1102,10 @@ ) ) ) - (when (and - (logtest? (-> obj flags) 8) - (< (-> obj bottom 1 y) f30-3) - (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096)) - ) + (when (and (logtest? (-> obj flags) 8) + (< (-> obj bottom 1 y) f30-3) + (and (< f30-3 (-> obj bottom 0 y)) (logtest? s5-0 4096)) + ) (logior! (-> obj flags) 2048) (let ((a1-30 (new 'stack-no-clear 'vector))) (set! (-> a1-30 quad) (-> obj bottom 0 quad)) @@ -1135,10 +1123,9 @@ ) ) (when (and (logtest? #x20000 (-> obj flags)) (= (-> obj process type) target)) - (when (and - (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025) - (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512)) - ) + (when (and (logtest? (-> (the-as collide-shape-moving (-> obj process root)) status) 1025) + (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) 512)) + ) (when (< (-> obj process root trans y) -409.6) (send-event (-> obj process) 'no-look-around 450) (when (zero? (logand (-> (the-as collide-shape-moving (-> obj process root)) root-prim prim-core action) #x4000)) @@ -1229,10 +1216,9 @@ (let* ((s5-2 (rand-vu-int-range 3 (+ (-> obj process node-list length) -1))) (v1-328 (vector<-cspace! (new 'stack-no-clear 'vector) (-> obj process node-list data s5-2))) ) - (when (and - (< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height)) - (< (-> obj height) (-> v1-328 y)) - ) + (when (and (< (- (-> v1-328 y) (-> obj process root trans y)) (-> obj drip-height)) + (< (-> obj height) (-> v1-328 y)) + ) (set! (-> obj drip-joint-index) s5-2) (set! (-> obj drip-old-pos quad) (-> v1-328 quad)) (logior! (-> obj flags) #x8000) @@ -1469,11 +1455,10 @@ ) (else (let ((v1-15 (-> (the-as target (-> obj target process 0)) water))) - (when (and - (logtest? #x80000 (-> obj flags)) - (logtest? (-> v1-15 flags) 512) - (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) - ) + (when (and (logtest? #x80000 (-> obj flags)) + (logtest? (-> v1-15 flags) 512) + (>= (-> v1-15 surface-height) (-> v1-15 bottom 0 y)) + ) (let ((v1-18 (-> obj attack-event))) (case v1-18 ((#f) @@ -1518,10 +1503,9 @@ ) ) ) - ((and - *target* - (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) - ) + ((and *target* + (and (not (handle->process (-> *target* water volume))) (dummy-10 (-> obj vol) (-> *target* control trans))) + ) (let ((s5-0 (-> *target* water))) (process-entity-status! obj (entity-perm-status bit-3) #t) (set! (-> s5-0 volume) (process->handle obj)) @@ -1552,7 +1536,10 @@ (defstate water-vol-startup (water-vol) :virtual #t :code - (behavior () (go-virtual water-vol-idle) (none)) + (behavior () + (go-virtual water-vol-idle) + (none) + ) ) ;; failed to figure out what this is: @@ -1568,9 +1555,15 @@ ) ) :exit - (behavior () (dummy-27 self) (none)) + (behavior () + (dummy-27 self) + (none) + ) :trans - (behavior () (TODO-RENAME-26 self) (none)) + (behavior () + (TODO-RENAME-26 self) + (none) + ) :code (the-as (function none :behavior water-vol) anim-loop) ) diff --git a/test/decompiler/reference/engine/level/level_REF.gc b/test/decompiler/reference/engine/level/level_REF.gc index 4cd0c8d809..e447642b40 100644 --- a/test/decompiler/reference/engine/level/level_REF.gc +++ b/test/decompiler/reference/engine/level/level_REF.gc @@ -733,12 +733,11 @@ (defmethod unload! level ((obj level)) (deactivate obj) (when (!= (-> obj status) 'inactive) - (when (or - (= (-> obj status) 'loaded) - (= (-> obj status) 'alive) - (= (-> obj status) 'active) - (= (-> obj status) 'login) - ) + (when (or (= (-> obj status) 'loaded) + (= (-> obj status) 'alive) + (= (-> obj status) 'active) + (= (-> obj status) 'login) + ) (dotimes (s5-0 (-> obj art-group art-group-array length)) (let ((s4-0 (-> obj art-group art-group-array s5-0))) (if (needs-link? s4-0) @@ -767,10 +766,9 @@ (unlink-part-group-by-heap (-> obj heap)) (dotimes (s5-2 2) (let ((v1-41 (-> *art-control* buffer s5-2 pending-load-file))) - (if (and - (>= (the-as int v1-41) (the-as int (-> obj heap base))) - (< (the-as int v1-41) (the-as int (-> obj heap top-base))) - ) + (if (and (>= (the-as int v1-41) (the-as int (-> obj heap base))) + (< (the-as int v1-41) (the-as int (-> obj heap top-base))) + ) (set-pending-file (-> *art-control* buffer s5-2) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) ) @@ -834,14 +832,13 @@ (v1-5 (-> a0-1 data)) ) (countdown (a0-2 (-> a0-1 length)) - (if (and - (>= (-> arg0 x) (-> v1-5 0 min x)) - (>= (-> arg0 y) (-> v1-5 0 min y)) - (>= (-> arg0 z) (-> v1-5 0 min z)) - (< (-> arg0 x) (-> v1-5 0 max x)) - (< (-> arg0 y) (-> v1-5 0 max y)) - (< (-> arg0 z) (-> v1-5 0 max z)) - ) + (if (and (>= (-> arg0 x) (-> v1-5 0 min x)) + (>= (-> arg0 y) (-> v1-5 0 min y)) + (>= (-> arg0 z) (-> v1-5 0 min z)) + (< (-> arg0 x) (-> v1-5 0 max x)) + (< (-> arg0 y) (-> v1-5 0 max y)) + (< (-> arg0 z) (-> v1-5 0 max z)) + ) (return (the-as symbol #t)) ) (set! v1-5 (the-as (inline-array box8s) (-> v1-5 1))) @@ -864,14 +861,13 @@ (s2-0 (the-as object (-> s3-0 data))) ) (dotimes (s1-0 (-> s3-0 length)) - (if (and - (>= (-> arg0 x) (-> (the-as (inline-array box8s) s2-0) 0 min x)) - (>= (-> arg0 y) (-> (the-as (inline-array box8s) s2-0) 0 min y)) - (>= (-> arg0 z) (-> (the-as (inline-array box8s) s2-0) 0 min z)) - (< (-> arg0 x) (-> (the-as (inline-array box8s) s2-0) 0 max x)) - (< (-> arg0 y) (-> (the-as (inline-array box8s) s2-0) 0 max y)) - (< (-> arg0 z) (-> (the-as (inline-array box8s) s2-0) 0 max z)) - ) + (if (and (>= (-> arg0 x) (-> (the-as (inline-array box8s) s2-0) 0 min x)) + (>= (-> arg0 y) (-> (the-as (inline-array box8s) s2-0) 0 min y)) + (>= (-> arg0 z) (-> (the-as (inline-array box8s) s2-0) 0 min z)) + (< (-> arg0 x) (-> (the-as (inline-array box8s) s2-0) 0 max x)) + (< (-> arg0 y) (-> (the-as (inline-array box8s) s2-0) 0 max y)) + (< (-> arg0 z) (-> (the-as (inline-array box8s) s2-0) 0 max z)) + ) (format arg1 " splitbox-~D~%" (-> obj bsp split-box-indices s1-0)) ) (set! s2-0 (-> (the-as (inline-array box8s) s2-0) 1)) @@ -1009,10 +1005,9 @@ (dotimes (v1-18 (-> obj length)) (case (-> obj level v1-18 status) (('active) - (if (and - (not (-> obj level v1-18 inside-boxes?)) - (or (not v0-0) (< (-> obj level v1-18 info priority) (-> v0-0 info priority))) - ) + (if (and (not (-> obj level v1-18 inside-boxes?)) + (or (not v0-0) (< (-> obj level v1-18 info priority) (-> v0-0 info priority))) + ) (set! v0-0 (-> obj level v1-18)) ) ) @@ -1025,10 +1020,9 @@ ;; definition for method 9 of type level-group (defmethod level-get level-group ((obj level-group) (arg0 symbol)) (dotimes (v1-0 (-> obj length)) - (if (and - (!= (-> obj level v1-0 status) 'inactive) - (or (= (-> obj level v1-0 name) arg0) (= (-> obj level v1-0 load-name) arg0)) - ) + (if (and (!= (-> obj level v1-0 status) 'inactive) + (or (= (-> obj level v1-0 name) arg0) (= (-> obj level v1-0 load-name) arg0)) + ) (return (-> obj level v1-0)) ) ) @@ -1165,11 +1159,10 @@ ) ) (let ((gp-1 (level-get-for-use *level* arg0 'active))) - (while (and - gp-1 - (or (= (-> gp-1 status) 'loading) (= (-> gp-1 status) 'loading-bt) (= (-> gp-1 status) 'login)) - (not *dproc*) - ) + (while (and gp-1 + (or (= (-> gp-1 status) 'loading) (= (-> gp-1 status) 'loading-bt) (= (-> gp-1 status) 'login)) + (not *dproc*) + ) (load-continue gp-1) ) (vis-load gp-1) @@ -1532,22 +1525,20 @@ (if (and (-> s4-1 inside-boxes?) (not (-> s4-1 other inside-boxes?))) (set! (-> s4-1 other meta-inside?) #f) ) - (when (and - (null? (-> obj load-commands)) - (= (-> s4-1 nickname) (-> *load-state* vis-nick)) - (!= (-> s4-1 name) (-> *game-info* current-continue level)) - (-> *level* border?) - ) + (when (and (null? (-> obj load-commands)) + (= (-> s4-1 nickname) (-> *load-state* vis-nick)) + (!= (-> s4-1 name) (-> *game-info* current-continue level)) + (-> *level* border?) + ) (let ((s3-0 (the-as continue-point (car (-> s4-1 info continues))))) (let* ((s2-0 (target-pos 0)) (s4-2 (-> s4-1 info continues)) (s1-0 (the-as continue-point (car s4-2))) ) (while (not (null? s4-2)) - (if (and - (< (vector-vector-distance s2-0 (-> s1-0 trans)) (vector-vector-distance s2-0 (-> s3-0 trans))) - (zero? (-> s1-0 flags)) - ) + (if (and (< (vector-vector-distance s2-0 (-> s1-0 trans)) (vector-vector-distance s2-0 (-> s3-0 trans))) + (zero? (-> s1-0 flags)) + ) (set! s3-0 s1-0) ) (set! s4-2 (cdr s4-2)) diff --git a/test/decompiler/reference/engine/level/load-boundary_REF.gc b/test/decompiler/reference/engine/level/load-boundary_REF.gc index 54a8891f34..6fb38ce310 100644 --- a/test/decompiler/reference/engine/level/load-boundary_REF.gc +++ b/test/decompiler/reference/engine/level/load-boundary_REF.gc @@ -1768,12 +1768,11 @@ ) ) ) - (when (and - s4-0 - (nonzero? (-> (the-as process-drawable s4-0) draw)) - (nonzero? (-> (the-as process-drawable s4-0) draw art-group)) - (string= (the-as string arg0) (-> (the-as process-drawable s4-0) draw art-group name)) - ) + (when (and s4-0 + (nonzero? (-> (the-as process-drawable s4-0) draw)) + (nonzero? (-> (the-as process-drawable s4-0) draw art-group)) + (string= (the-as string arg0) (-> (the-as process-drawable s4-0) draw art-group name)) + ) (set! arg0 s4-0) (goto cfg-56) ) diff --git a/test/decompiler/reference/engine/load/loader_REF.gc b/test/decompiler/reference/engine/load/loader_REF.gc index b8776110fa..a710f8f08a 100644 --- a/test/decompiler/reference/engine/load/loader_REF.gc +++ b/test/decompiler/reference/engine/load/loader_REF.gc @@ -214,10 +214,9 @@ (let ((janim-group (art-group-get-by-name (-> *level* level s3-1) (-> janim master-art-group-name)))) (when janim-group (cond - ((and - (< (-> janim master-art-group-index) (-> janim-group length)) - (not (-> janim-group data (-> janim master-art-group-index))) - ) + ((and (< (-> janim master-art-group-index) (-> janim-group length)) + (not (-> janim-group data (-> janim master-art-group-index))) + ) (set! (-> janim-group data (-> janim master-art-group-index)) janim) (set! success #t) ) @@ -304,10 +303,9 @@ ;; definition for method 10 of type external-art-buffer ;; WARN: Found some very strange gotos. Check result carefully, this is not well tested. (defmethod update external-art-buffer ((obj external-art-buffer)) - (when (or - (not (name= (-> obj pending-load-file) (-> obj load-file))) - (!= (-> obj pending-load-file-part) (-> obj load-file-part)) - ) + (when (or (not (name= (-> obj pending-load-file) (-> obj load-file))) + (!= (-> obj pending-load-file-part) (-> obj load-file-part)) + ) (when (not (handle->process (-> obj pending-load-file-owner))) (set! (-> obj pending-load-file) #f) (set! (-> obj pending-load-file-part) -1) @@ -540,12 +538,11 @@ ) (when (not (-> obj reserve-buffer)) (let ((s4-2 (-> obj rec 0 buf2))) - (if (and - s4-2 - (-> s4-2 locked?) - (not (string= (-> s4-2 pending-load-file) "reserved")) - (not (string= (-> s4-2 other pending-load-file) "reserved")) - ) + (if (and s4-2 + (-> s4-2 locked?) + (not (string= (-> s4-2 pending-load-file) "reserved")) + (not (string= (-> s4-2 other pending-load-file) "reserved")) + ) (set-pending-file (-> s4-2 other) (the-as string #f) -1 (the-as handle #f) 100000000.0) ) ) @@ -836,8 +833,8 @@ (cond (arg1 (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) arg1 ) (ja-channel-push! 1 15) @@ -880,8 +877,8 @@ (cond (arg1 (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) arg1 ) (ja-channel-set! 1) @@ -935,8 +932,7 @@ (if (= (-> self skel root-channel 0) (-> self skel channel)) (logior! (-> self skel status) 32) ) - (if (or - (arg3 self) + (if (or (arg3 self) (and (<= sv-72 0) (>= (- (-> *display* base-frame-counter) sv-40) 1200)) (and (< 300 sv-56) (<= sv-72 0)) ) diff --git a/test/decompiler/reference/engine/math/matrix_REF.gc b/test/decompiler/reference/engine/math/matrix_REF.gc index 3222f69223..1e97fd0c5b 100644 --- a/test/decompiler/reference/engine/math/matrix_REF.gc +++ b/test/decompiler/reference/engine/math/matrix_REF.gc @@ -970,18 +970,18 @@ (f12-0 (-> dst vector 3 w)) ) (- (+ (* f15-0 f6-0 f8-0 f12-0) - (* f15-0 f3-0 f13-0 f7-0) - (* f15-0 f11-0 f1-0 f4-0) - (* f14-0 f9-0 f13-0 f4-0) - (* f14-0 f3-0 f5-0 f4-0) - (* f14-0 f11-0 f8-0 f0-0) - (* f10-0 f9-0 f1-0 f12-0) - (* f10-0 f6-0 f13-0 f0-0) - (* f10-0 f11-0 f5-0 f7-0) - (* f2-0 f9-0 f1-0 f4-0) - (* f2-0 f6-0 f8-0 f0-0) - (* f2-0 f3-0 f5-0 f7-0) - ) + (* f15-0 f3-0 f13-0 f7-0) + (* f15-0 f11-0 f1-0 f4-0) + (* f14-0 f9-0 f13-0 f4-0) + (* f14-0 f3-0 f5-0 f4-0) + (* f14-0 f11-0 f8-0 f0-0) + (* f10-0 f9-0 f1-0 f12-0) + (* f10-0 f6-0 f13-0 f0-0) + (* f10-0 f11-0 f5-0 f7-0) + (* f2-0 f9-0 f1-0 f4-0) + (* f2-0 f6-0 f8-0 f0-0) + (* f2-0 f3-0 f5-0 f7-0) + ) (+ (* f15-0 f6-0 f13-0 f4-0) (* f15-0 f3-0 f1-0 f12-0) (* f15-0 f11-0 f8-0 f7-0) @@ -1013,8 +1013,8 @@ (f1-0 (-> src vector 3 w)) ) (set! (-> dst vector 0 x) (/ (- (+ (* f9-0 f6-0 f1-0) (* f2-0 f10-0 f4-0) (* f5-0 f3-0 f7-0)) - (+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0)) - ) + (+ (* f9-0 f10-0 f7-0) (* f5-0 f6-0 f4-0) (* f2-0 f3-0 f1-0)) + ) f0-0 ) ) @@ -1030,8 +1030,8 @@ (f1-6 (-> src vector 3 w)) ) (set! (-> dst vector 0 y) (- (/ (- (+ (* f9-2 f6-1 f1-6) (* f2-2 f10-1 f4-3) (* f5-2 f3-1 f7-2)) - (+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6)) - ) + (+ (* f9-2 f10-1 f7-2) (* f5-2 f6-1 f4-3) (* f2-2 f3-1 f1-6)) + ) f0-0 ) ) @@ -1048,8 +1048,8 @@ (f1-13 (-> src vector 3 w)) ) (set! (-> dst vector 0 z) (/ (- (+ (* f9-4 f6-2 f1-13) (* f2-4 f10-2 f4-6) (* f5-4 f3-2 f7-4)) - (+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13)) - ) + (+ (* f9-4 f10-2 f7-4) (* f5-4 f6-2 f4-6) (* f2-4 f3-2 f1-13)) + ) f0-0 ) ) @@ -1065,8 +1065,8 @@ (f1-19 (-> src vector 3 z)) ) (set! (-> dst vector 0 w) (- (/ (- (+ (* f9-6 f6-3 f1-19) (* f2-6 f10-3 f4-9) (* f5-6 f3-3 f7-6)) - (+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19)) - ) + (+ (* f9-6 f10-3 f7-6) (* f5-6 f6-3 f4-9) (* f2-6 f3-3 f1-19)) + ) f0-0 ) ) @@ -1083,8 +1083,8 @@ (f1-26 (-> src vector 3 w)) ) (set! (-> dst vector 1 x) (- (/ (- (+ (* f9-8 f6-4 f1-26) (* f2-8 f10-4 f4-12) (* f5-8 f3-4 f7-8)) - (+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26)) - ) + (+ (* f9-8 f10-4 f7-8) (* f5-8 f6-4 f4-12) (* f2-8 f3-4 f1-26)) + ) f0-0 ) ) @@ -1101,8 +1101,8 @@ (f1-33 (-> src vector 3 w)) ) (set! (-> dst vector 1 y) (/ (- (+ (* f9-10 f6-5 f1-33) (* f2-10 f10-5 f4-15) (* f5-10 f3-5 f7-10)) - (+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33)) - ) + (+ (* f9-10 f10-5 f7-10) (* f5-10 f6-5 f4-15) (* f2-10 f3-5 f1-33)) + ) f0-0 ) ) @@ -1118,8 +1118,8 @@ (f1-39 (-> src vector 3 w)) ) (set! (-> dst vector 1 z) (- (/ (- (+ (* f9-12 f6-6 f1-39) (* f2-12 f10-6 f4-18) (* f5-12 f3-6 f7-12)) - (+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39)) - ) + (+ (* f9-12 f10-6 f7-12) (* f5-12 f6-6 f4-18) (* f2-12 f3-6 f1-39)) + ) f0-0 ) ) @@ -1136,8 +1136,8 @@ (f1-46 (-> src vector 3 z)) ) (set! (-> dst vector 1 w) (/ (- (+ (* f9-14 f6-7 f1-46) (* f2-14 f10-7 f4-21) (* f5-14 f3-7 f7-14)) - (+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46)) - ) + (+ (* f9-14 f10-7 f7-14) (* f5-14 f6-7 f4-21) (* f2-14 f3-7 f1-46)) + ) f0-0 ) ) @@ -1153,8 +1153,8 @@ (f1-52 (-> src vector 3 w)) ) (set! (-> dst vector 2 x) (/ (- (+ (* f9-16 f6-8 f1-52) (* f2-16 f10-8 f4-24) (* f5-16 f3-8 f7-16)) - (+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52)) - ) + (+ (* f9-16 f10-8 f7-16) (* f5-16 f6-8 f4-24) (* f2-16 f3-8 f1-52)) + ) f0-0 ) ) @@ -1170,8 +1170,8 @@ (f1-58 (-> src vector 3 w)) ) (set! (-> dst vector 2 y) (- (/ (- (+ (* f9-18 f6-9 f1-58) (* f2-18 f10-9 f4-27) (* f5-18 f3-9 f7-18)) - (+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58)) - ) + (+ (* f9-18 f10-9 f7-18) (* f5-18 f6-9 f4-27) (* f2-18 f3-9 f1-58)) + ) f0-0 ) ) @@ -1188,8 +1188,8 @@ (f1-65 (-> src vector 3 w)) ) (set! (-> dst vector 2 z) (/ (- (+ (* f9-20 f6-10 f1-65) (* f2-20 f10-10 f4-30) (* f5-20 f3-10 f7-20)) - (+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65)) - ) + (+ (* f9-20 f10-10 f7-20) (* f5-20 f6-10 f4-30) (* f2-20 f3-10 f1-65)) + ) f0-0 ) ) @@ -1205,8 +1205,8 @@ (f1-71 (-> src vector 3 z)) ) (set! (-> dst vector 2 w) (- (/ (- (+ (* f9-22 f6-11 f1-71) (* f2-22 f10-11 f4-33) (* f5-22 f3-11 f7-22)) - (+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71)) - ) + (+ (* f9-22 f10-11 f7-22) (* f5-22 f6-11 f4-33) (* f2-22 f3-11 f1-71)) + ) f0-0 ) ) @@ -1223,8 +1223,8 @@ (f1-78 (-> src vector 2 w)) ) (set! (-> dst vector 3 x) (- (/ (- (+ (* f9-24 f6-12 f1-78) (* f2-24 f10-12 f4-36) (* f5-24 f3-12 f7-24)) - (+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78)) - ) + (+ (* f9-24 f10-12 f7-24) (* f5-24 f6-12 f4-36) (* f2-24 f3-12 f1-78)) + ) f0-0 ) ) @@ -1241,8 +1241,8 @@ (f1-85 (-> src vector 2 w)) ) (set! (-> dst vector 3 y) (/ (- (+ (* f9-26 f6-13 f1-85) (* f2-26 f10-13 f4-39) (* f5-26 f3-13 f7-26)) - (+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85)) - ) + (+ (* f9-26 f10-13 f7-26) (* f5-26 f6-13 f4-39) (* f2-26 f3-13 f1-85)) + ) f0-0 ) ) @@ -1258,8 +1258,8 @@ (f1-91 (-> src vector 2 w)) ) (set! (-> dst vector 3 z) (- (/ (- (+ (* f9-28 f6-14 f1-91) (* f2-28 f10-14 f4-42) (* f5-28 f3-14 f7-28)) - (+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91)) - ) + (+ (* f9-28 f10-14 f7-28) (* f5-28 f6-14 f4-42) (* f2-28 f3-14 f1-91)) + ) f0-0 ) ) @@ -1276,8 +1276,8 @@ (f3-15 (-> src vector 2 z)) ) (set! (-> dst vector 3 w) (/ (- (+ (* f8-60 f6-15 f3-15) (* f1-98 f9-30 f4-45) (* f5-30 f2-30 f7-30)) - (+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15)) - ) + (+ (* f8-60 f9-30 f7-30) (* f5-30 f6-15 f4-45) (* f1-98 f2-30 f3-15)) + ) f0-0 ) ) diff --git a/test/decompiler/reference/engine/math/quaternion_REF.gc b/test/decompiler/reference/engine/math/quaternion_REF.gc index 01f0c55a8b..ee3782fbd5 100644 --- a/test/decompiler/reference/engine/math/quaternion_REF.gc +++ b/test/decompiler/reference/engine/math/quaternion_REF.gc @@ -455,10 +455,10 @@ (let ((f0-12 (sqrtf (+ (- 1.0 - (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a3-0 16)) (the-as int arg1)))) - (-> (the-as (pointer float) (+ (+ (* v1-1 4) (* v1-1 16)) (the-as int arg1)))) - ) - ) + (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a3-0 16)) (the-as int arg1)))) + (-> (the-as (pointer float) (+ (+ (* v1-1 4) (* v1-1 16)) (the-as int arg1)))) + ) + ) (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a2-0 16)) (the-as int arg1)))) ) ) @@ -470,22 +470,22 @@ ) (set! (-> arg0 w) (* (- (-> (the-as (pointer float) (+ (+ (* v1-1 4) (* a3-0 16)) (the-as int arg1)))) - (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* v1-1 16)) (the-as int arg1)))) - ) + (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* v1-1 16)) (the-as int arg1)))) + ) f0-12 ) ) (set! (-> arg0 data a3-0) (* (+ (-> (the-as (pointer float) (+ (+ (* a3-0 4) (* a2-0 16)) (the-as int arg1)))) - (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a3-0 16)) (the-as int arg1)))) - ) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* a3-0 16)) (the-as int arg1)))) + ) f0-12 ) ) (set! (-> arg0 data v1-1) (* (+ (-> (the-as (pointer float) (+ (+ (* v1-1 4) (* a2-0 16)) (the-as int arg1)))) - (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* v1-1 16)) (the-as int arg1)))) - ) + (-> (the-as (pointer float) (+ (+ (* a2-0 4) (* v1-1 16)) (the-as int arg1)))) + ) f0-12 ) ) diff --git a/test/decompiler/reference/engine/math/transformq_REF.gc b/test/decompiler/reference/engine/math/transformq_REF.gc index 928e0755e3..495fe55b51 100644 --- a/test/decompiler/reference/engine/math/transformq_REF.gc +++ b/test/decompiler/reference/engine/math/transformq_REF.gc @@ -40,14 +40,12 @@ ) (let ((old-diff (-> obj old-y-angle-diff))) (set! saturated-yaw (cond - ((or - (= old-diff 0.0) - (and (< 0.0 saturated-yaw) (< 0.0 old-diff)) - (or - (and (< saturated-yaw 0.0) (< old-diff 0.0)) - (>= (- (-> *display* base-frame-counter) (-> obj angle-change-time)) 60) + ((or (= old-diff 0.0) + (and (< 0.0 saturated-yaw) (< 0.0 old-diff)) + (or (and (< saturated-yaw 0.0) (< old-diff 0.0)) + (>= (- (-> *display* base-frame-counter) (-> obj angle-change-time)) 60) + ) ) - ) (set! (-> obj angle-change-time) (-> *display* base-frame-counter)) saturated-yaw ) diff --git a/test/decompiler/reference/engine/ps2/pad_REF.gc b/test/decompiler/reference/engine/ps2/pad_REF.gc index 18be63f75f..7303ffe3e3 100644 --- a/test/decompiler/reference/engine/ps2/pad_REF.gc +++ b/test/decompiler/reference/engine/ps2/pad_REF.gc @@ -283,8 +283,7 @@ (set! (-> pad stick0-speed) 0.0) ) ) - (if (or - (!= (-> pad button0-abs 0) (-> pad button0-abs 1)) + (if (or (!= (-> pad button0-abs 0) (-> pad button0-abs 1)) (or (< 0.3 (-> pad stick0-speed)) (zero? (-> pad change-time))) ) (set! (-> pad change-time) (get-current-time)) diff --git a/test/decompiler/reference/engine/sound/gsound_REF.gc b/test/decompiler/reference/engine/sound/gsound_REF.gc index 92c1ebe866..3433759ca7 100644 --- a/test/decompiler/reference/engine/sound/gsound_REF.gc +++ b/test/decompiler/reference/engine/sound/gsound_REF.gc @@ -743,10 +743,9 @@ (effect-param->sound-spec spec (-> obj params) (-> obj param-count)) ) ) - (if (and - (nonzero? (-> spec fo-max)) - (< (* 4096.0 (the float (-> spec fo-max))) (vector-vector-distance (ear-trans) (-> obj trans))) - ) + (if (and (nonzero? (-> spec fo-max)) + (< (* 4096.0 (the float (-> spec fo-max))) (vector-vector-distance (ear-trans) (-> obj trans))) + ) (return 0) ) (when (and *debug-effect-control* (>= (-> obj time-base) 0)) @@ -818,11 +817,10 @@ (set! (-> cmd id) (-> obj playing-id)) (let ((s4-1 pp)) (when (= arg0 #t) - (if (and - (the-as process-drawable s4-1) - (type-type? (-> (the-as process-drawable s4-1) type) process-drawable) - (nonzero? (-> (the-as process-drawable s4-1) root)) - ) + (if (and (the-as process-drawable s4-1) + (type-type? (-> (the-as process-drawable s4-1) type) process-drawable) + (nonzero? (-> (the-as process-drawable s4-1) root)) + ) (set! arg0 (-> (the-as process-drawable s4-1) root trans)) (set! arg0 (the-as vector #f)) ) diff --git a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc index a7c96255e9..0e4b857469 100644 --- a/test/decompiler/reference/engine/target/joint-mod-h_REF.gc +++ b/test/decompiler/reference/engine/target/joint-mod-h_REF.gc @@ -277,13 +277,11 @@ ) ) (let ((dist (vector-vector-distance (-> obj process root trans) target-trans))) - (when (and - (or - (= (-> obj blend) 0.0) - (or (< dist (vector-vector-distance (-> obj process root trans) (-> obj target))) (= option 'force)) - ) - (< dist (-> obj max-dist)) - ) + (when (and (or (= (-> obj blend) 0.0) + (or (< dist (vector-vector-distance (-> obj process root trans) (-> obj target))) (= option 'force)) + ) + (< dist (-> obj max-dist)) + ) (if (= (-> obj mode) (joint-mod-handler-mode reset)) (set-mode! obj (joint-mod-handler-mode look-at)) ) diff --git a/test/decompiler/reference/engine/target/logic-target_REF.gc b/test/decompiler/reference/engine/target/logic-target_REF.gc index 69573666ce..00751d6dcb 100644 --- a/test/decompiler/reference/engine/target/logic-target_REF.gc +++ b/test/decompiler/reference/engine/target/logic-target_REF.gc @@ -5,10 +5,9 @@ ;; Used lq/sq (defbehavior build-conversions target ((arg0 vector)) (surface-mult! (-> self control unknown-surface01) (-> self control unknown-surface00) (-> self control surf)) - (when (and - (and (= (-> self fact-info-target eco-type) 3) (>= (-> self fact-info-target eco-level) 1.0)) - (or (= (-> self control unknown-surface00 name) 'run) (= (-> self control unknown-surface00 name) 'jump)) - ) + (when (and (and (= (-> self fact-info-target eco-type) 3) (>= (-> self fact-info-target eco-level) 1.0)) + (or (= (-> self control unknown-surface00 name) 'run) (= (-> self control unknown-surface00 name) 'jump)) + ) (set! (-> self control unknown-surface01 target-speed) (+ 20480.0 (-> self control unknown-surface01 target-speed)) ) @@ -571,16 +570,15 @@ (if (logtest? (-> self control unknown-surface01 flags) 8) (set! (-> v1-6 0) (the-as uint (-> *display* base-frame-counter))) ) - (and - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) - (< f0-1 0.0) - (< 32768.0 f1-1) - (< 0.7 (-> self control unknown-float20)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) 90) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) 90) - (logtest? (-> self control status) 1) - (and (< 0.7 (-> self control surface-angle)) #t) - ) + (and (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> v1-6 0)))) (the-as uint 300)) + (< f0-1 0.0) + (< 32768.0 f1-1) + (< 0.7 (-> self control unknown-float20)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) 90) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) 90) + (logtest? (-> self control status) 1) + (and (< 0.7 (-> self control surface-angle)) #t) + ) ) ) ) @@ -780,33 +778,32 @@ ) ) ) - (if (and - (zero? (logand (-> self control status) 8)) - (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) - (< 0.0 (-> gp-0 y)) - (< 0.0 (vector-dot - (-> self control dynam gravity-normal) - (vector-! - (new 'stack-no-clear 'vector) - (the-as vector (-> self control unknown-sphere-array00 1 prim-core)) - (-> self control unknown-vector70) - ) - ) - ) - ) + (if (and (zero? (logand (-> self control status) 8)) + (logtest? (-> self control old-status) 8) + (logtest? (-> self control unknown-surface00 flags) 2048) + (< 0.0 (-> gp-0 y)) + (< 0.0 (vector-dot + (-> self control dynam gravity-normal) + (vector-! + (new 'stack-no-clear 'vector) + (the-as vector (-> self control unknown-sphere-array00 1 prim-core)) + (-> self control unknown-vector70) + ) + ) + ) + ) (set! (-> self control unknown-dword70) (-> *display* base-frame-counter)) ) (if (< (- (-> *display* base-frame-counter) (-> self control unknown-dword70)) 60) (set! f30-4 (+ 204800.0 f30-4)) ) - (if (and (zero? (logand (-> self control status) 8)) (and - (logtest? (-> self control old-status) 8) - (logtest? (-> self control unknown-surface00 flags) 2048) - (< 0.0 (-> gp-0 y)) - (< (-> gp-0 z) 0.0) - ) - ) + (if (and (zero? (logand (-> self control status) 8)) + (and (logtest? (-> self control old-status) 8) + (logtest? (-> self control unknown-surface00 flags) 2048) + (< 0.0 (-> gp-0 y)) + (< (-> gp-0 z) 0.0) + ) + ) (set! (-> gp-0 z) 0.0) ) (let ((s4-2 (vector-! (new-stack-vector0) s5-0 gp-0))) @@ -926,18 +923,16 @@ (defbehavior do-rotations2 target () (let ((gp-0 (vector-z-quaternion! (new-stack-vector0) (-> self control dir-targ))) (s5-0 - (if (and - (or - (zero? (logand (logior (-> self control status) (-> self control old-status)) 5)) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) 150) - (!= (-> self next-state name) 'target-walk) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 150) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) 150) - (logtest? (-> self control unknown-surface01 flags) 16) - (!= (-> self control unknown-float41) 0.0) - ) - (zero? (logand (-> self control unknown-surface01 flags) 32)) - ) + (if (and (or (zero? (logand (logior (-> self control status) (-> self control old-status)) 5)) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword20)) 150) + (!= (-> self next-state name) 'target-walk) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword21)) 150) + (logtest? (-> self control unknown-surface01 flags) 16) + (!= (-> self control unknown-float41) 0.0) + ) + (zero? (logand (-> self control unknown-surface01 flags) 32)) + ) (-> self control unknown-vector20) (-> self control transv) ) @@ -1008,10 +1003,9 @@ (let ((gp-0 (-> self current-level))) (set! (-> self current-level) (level-get-target-inside *level*)) (if (and (-> self current-level) (>= (-> *level-task-data-remap* length) (-> self current-level info index))) - (+! - (-> *game-info* in-level-time (-> *level-task-data-remap* (+ (-> self current-level info index) -1))) - (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) - ) + (+! (-> *game-info* in-level-time (-> *level-task-data-remap* (+ (-> self current-level info index) -1))) + (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) + ) ) (if (and (or (not gp-0) (!= (-> gp-0 name) (-> self current-level name))) (-> self current-level)) (send-event self 'level-enter (-> self current-level name)) @@ -1032,11 +1026,10 @@ ((logtest? (-> self control status) 1) (set! (-> self control unknown-dword11) (-> *display* base-frame-counter)) (set! (-> self control unknown-vector52 quad) (-> self control trans quad)) - (if (and - (>= (-> self control coverage) 1.0) - (zero? (logand (-> self control status) 1056)) - (logtest? (-> self control status) 2) - ) + (if (and (>= (-> self control coverage) 1.0) + (zero? (logand (-> self control status) 1056)) + (logtest? (-> self control status) 2) + ) (set! (-> self control unknown-vector54 quad) (-> self control trans quad)) ) ((-> self control unknown-surface01 touch-hook)) @@ -1050,45 +1043,40 @@ (set! (-> self control unknown-vector111 x) (-> v1-25 x)) (set! (-> self control unknown-vector111 z) (-> v1-25 z)) (if (< (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector111) v1-25) - ) - 0.0 + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector111) v1-25) ) + 0.0 + ) (set! (-> self control unknown-vector111 y) (-> v1-25 y)) ) ) ) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons triangle) - ) - (zero? (-> self control unknown-int40)) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) - ) - (if (and - (= (-> self cam-user-mode) 'normal) - (logtest? (-> self control unknown-surface00 flags) 1) - (zero? (logand (-> self control root-prim prim-core action) #x7380)) - (-> *setting-control* current allow-look-around) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self no-look-around-wait))) 15) - (not (and - (= (-> self control ground-pat material) (pat-material ice)) - (< 4096.0 (-> self control unknown-float01)) - ) - ) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons triangle) + ) + (zero? (-> self control unknown-int40)) + (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + ) + (if (and (= (-> self cam-user-mode) 'normal) + (logtest? (-> self control unknown-surface00 flags) 1) + (zero? (logand (-> self control root-prim prim-core action) #x7380)) + (-> *setting-control* current allow-look-around) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self no-look-around-wait))) 15) + (not (and (= (-> self control ground-pat material) (pat-material ice)) + (< 4096.0 (-> self control unknown-float01)) + ) + ) + ) (send-event self 'change-mode 'look-around) ) ) - (when (and - (= *cheat-mode* 'debug) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - (not *pause-lock*) - (zero? (logand (-> self state-flags) 768)) - ) + (when (and (= *cheat-mode* 'debug) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (not *pause-lock*) + (zero? (logand (-> self state-flags) 768)) + ) (if (!= (-> self next-state name) 'target-falling) (send-event self 'change-mode 'falling) ) @@ -1132,50 +1120,42 @@ (set! (-> self control surf) *standard-ground-surface*) ) (let ((f0-17 (vector-dot (-> self control dynam gravity-normal) (-> self control transv)))) - (if (and - (or - (logtest? (-> self control unknown-surface01 flags) 1024) - (and (= (-> self next-state name) 'target-walk) (zero? (logand (-> self control status) 1))) - ) - (< f0-17 0.0) - (or - (not - (and - (= *cheat-mode* 'debug) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) - ) - *pause-lock* - ) - (and - (>= (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + (if (and (or (logtest? (-> self control unknown-surface01 flags) 1024) + (and (= (-> self next-state name) 'target-walk) (zero? (logand (-> self control status) 1))) + ) + (< f0-17 0.0) + (or (not + (and (= *cheat-mode* 'debug) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + *pause-lock* + ) + (and (>= (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + ) + 9420.8 ) - 9420.8 + (zero? (logand (-> self control root-prim prim-core action) #x4200)) + #t ) - (zero? (logand (-> self control root-prim prim-core action) #x4200)) - #t - ) - ) + ) (logior! (-> self control root-prim prim-core action) 64) (set! (-> self control root-prim prim-core action) (logand -65 (-> self control root-prim prim-core action))) ) ) (let ((v1-146 (-> self current-level))) - (when (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 600) - (and - v1-146 - (< (-> self control trans y) (-> v1-146 info bottom-height)) - (not - (and - (= *cheat-mode* 'debug) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ) + (when (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 600) + (and v1-146 + (< (-> self control trans y) (-> v1-146 info bottom-height)) + (not + (and (= *cheat-mode* 'debug) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) (let ((a1-32 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-32 from) self) (set! (-> a1-32 num-params) 2) @@ -1317,18 +1297,16 @@ (let ((s4-1 (vector-! (new-stack-vector0) (-> s5-0 center-hold) (-> self control unknown-vector90)))) (set! (-> self control unknown-float110) (vector-length s4-1)) (cond - ((and - (< 819.2 (-> self control unknown-float110)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) 60) - ) + ((and (< 819.2 (-> self control unknown-float110)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) 60) + ) (vector-normalize! s4-1 1228.8) (TODO-RENAME-28 (-> self control) s4-1) (vector-float*! (-> self control rider-last-move) s4-1 (-> *display* frames-per-second)) (set! (-> self control rider-time) (the-as uint (-> *display* base-frame-counter))) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword41)) 150) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) 150) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword41)) 150) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword40)) 150) + ) (send-event self 'end-mode) ) ) @@ -1460,8 +1438,8 @@ ) (let ((s5-3 (vector-cross! (-> self control unknown-vector101) gp-0 (-> self control dynam gravity-normal)))) (if (>= 0.0 - (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))) - ) + (vector-dot s5-3 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control unknown-quaternion00))) + ) (vector-negate! s5-3 s5-3) ) (forward-up-nopitch->quaternion (-> self control dir-targ) s5-3 (-> self control dynam gravity-normal)) @@ -1479,15 +1457,14 @@ (defbehavior target-calc-camera-pos target () (let ((gp-0 (new 'stack-no-clear 'vector))) (cond - ((and - (= (-> self next-state name) 'target-clone-anim) - (zero? (logand (-> self draw status) (draw-status drwf01))) - (begin - (vector<-cspace! gp-0 (-> self node-list data 3)) - (set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y))) - (< (fabs (- (-> gp-0 y) (-> self control trans y))) 8192.0) - ) - ) + ((and (= (-> self next-state name) 'target-clone-anim) + (zero? (logand (-> self draw status) (draw-status drwf01))) + (begin + (vector<-cspace! gp-0 (-> self node-list data 3)) + (set! (-> gp-0 y) (+ -5896.192 (-> gp-0 y))) + (< (fabs (- (-> gp-0 y) (-> self control trans y))) 8192.0) + ) + ) (set! (-> (&-> (-> self control) unknown-qword00) 0) (-> gp-0 quad)) ) (else @@ -1613,12 +1590,11 @@ (let ((s4-0 (new-stack-vector0))) (read-pad s4-0) (let ((f30-0 (-> self control unknown-float20))) - (if (and - (< 0.0 f30-0) - (< 0.3 (-> self control unknown-float20)) - (< (vector-dot (-> self control unknown-vector30) (-> self control unknown-vector31)) 0.2) - (< f30-0 0.7) - ) + (if (and (< 0.0 f30-0) + (< 0.3 (-> self control unknown-float20)) + (< (vector-dot (-> self control unknown-vector30) (-> self control unknown-vector31)) 0.2) + (< f30-0 0.7) + ) (set! f30-0 0.0) ) (when (!= (-> self control unknown-float41) 0.0) diff --git a/test/decompiler/reference/engine/target/sidekick_REF.gc b/test/decompiler/reference/engine/target/sidekick_REF.gc index af6c5af288..4390a0b6d1 100644 --- a/test/decompiler/reference/engine/target/sidekick_REF.gc +++ b/test/decompiler/reference/engine/target/sidekick_REF.gc @@ -124,11 +124,11 @@ (a0-0 (-> self parent-override)) ) (when (!= (-> (if a0-0 - (-> a0-0 0 self-override) - ) - next-state - name - ) + (-> a0-0 0 self-override) + ) + next-state + name + ) v1-0 ) (quaternion-copy! (-> self root quat) (-> self parent-override 0 control quat)) diff --git a/test/decompiler/reference/engine/target/target-death_REF.gc b/test/decompiler/reference/engine/target/target-death_REF.gc index aa1c983dd7..473a6f9f95 100644 --- a/test/decompiler/reference/engine/target/target-death_REF.gc +++ b/test/decompiler/reference/engine/target/target-death_REF.gc @@ -111,17 +111,15 @@ (set! (-> *load-state* want 1 force-inside?) #f) (when (not (string= (-> arg0 name) "default")) (while (not - (and - (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) - (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) - ) + (and (or (not (-> arg0 lev0)) (not (-> arg0 disp0)) (= (level-status *level* (-> arg0 lev0)) 'active)) + (or (not (-> arg0 lev1)) (not (-> arg0 disp1)) (= (level-status *level* (-> arg0 lev1)) 'active)) + ) ) (let ((v1-52 (lookup-level-info (-> arg0 level)))) - (if (and - v1-52 - (= (-> *setting-control* current music) (-> v1-52 music-bank)) - (zero? (logand (-> arg0 flags) 160)) - ) + (if (and v1-52 + (= (-> *setting-control* current music) (-> v1-52 music-bank)) + (zero? (logand (-> arg0 flags) 160)) + ) (clear-pending-settings-from-process *setting-control* self 'music-volume) ) ) @@ -218,13 +216,11 @@ ) ) ) - ((and - (logtest? (-> arg0 flags) 2048) - (or - (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) - (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) - ) - ) + ((and (logtest? (-> arg0 flags) 2048) + (or (= (get-task-status (game-task beach-ecorocks)) (task-status need-hint)) + (= (get-task-status (game-task beach-ecorocks)) (task-status need-introduction)) + ) + ) (let ((s5-4 (entity-by-name "sage-23"))) (when s5-4 (set-blackout-frames #x7530) @@ -661,34 +657,28 @@ (defbehavior target-hit-push target ((arg0 vector) (arg1 matrix) (arg2 float) (arg3 float) (arg4 attack-info)) (case (-> arg4 angle) (('jump 'up 'up-forward) - (when (and - (zero? (logand (-> self control root-prim prim-core action) #x4200)) - (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) - ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (when (and (zero? (logand (-> self control root-prim prim-core action) #x4200)) + (not (and (= (-> self game mode) 'play) (>= 0.0 (-> self fact-info-target health)))) + ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack-air #f) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + ) (go target-flop (the-as float 65502.96) @@ -703,18 +693,15 @@ ) ) ) - (when (if (and - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time))) - (not - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (when (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* stuck-time))) + (not + (and *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) ) - ) - ) - ) + ) #t ) (logior! (-> self control status) 1) @@ -741,12 +728,11 @@ ;; definition for function target-hit-orient (defbehavior target-hit-orient target ((arg0 attack-info) (arg1 vector)) (let ((s5-0 #f)) - (if (and - (!= (-> arg0 angle) 'front) - (!= (-> arg0 angle) 'shove) - (logtest? (-> arg0 mask) 2) - (!= (-> arg0 shove-back) 0.0) - ) + (if (and (!= (-> arg0 angle) 'front) + (!= (-> arg0 angle) 'shove) + (logtest? (-> arg0 mask) 2) + (!= (-> arg0 shove-back) 0.0) + ) (forward-up-nopitch->quaternion (-> self control dir-targ) arg1 (-> self control dynam gravity-normal)) ) (case (-> arg0 angle) @@ -780,8 +766,8 @@ (case (-> arg0 angle) (('back) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 74) ) ) @@ -801,8 +787,8 @@ ) (('up 'up-forward) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 75) ) ) @@ -852,8 +838,8 @@ ) (else (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 73) ) ) @@ -904,15 +890,15 @@ (set-quaternion! (-> self control) (-> self control dir-targ)) #t (let ((f28-1 (* 1.05 (/ (* -60.0 arg3) (* (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) - -1 - ) - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) + -1 + ) + ) (ja-step 0) ) ) @@ -979,10 +965,9 @@ :trans (behavior () (when (= *cheat-mode* 'debug) - (when (and - (not *pause-lock*) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) + (when (and (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-stance) ) @@ -1536,8 +1521,8 @@ ) (+! (-> *game-info* death-movie-tick) 1) (if (= (death-movie-remap (+ (-> *game-info* death-movie-tick) -1) (-> *death-spool-array* length)) - (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length)) - ) + (death-movie-remap (-> *game-info* death-movie-tick) (-> *death-spool-array* length)) + ) (+! (-> *game-info* death-movie-tick) 1) ) (let ((gp-18 @@ -1546,24 +1531,22 @@ ) (set-setting! *setting-control* self 'allow-progress #f (the-as float 0.0) 0) (target-death-anim gp-18) - (when (and - (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) - (zero? (logand (-> self water flags) 512)) - (!= (-> self control ground-pat material) 9) - (!= (-> self control ground-pat material) 10) - ) + (when (and (< (rand-vu-int-count (-> *game-info* death-movie-tick)) (* (-> *death-spool-array* length) 2)) + (zero? (logand (-> self water flags) 512)) + (!= (-> self control ground-pat material) 9) + (!= (-> self control ground-pat material) 10) + ) (iterate-process-tree *entity-pool* (lambda :behavior target ((arg0 process)) - (if (and - (logtest? (process-mask enemy) (-> arg0 mask)) - (type-type? (-> arg0 type) process-drawable) - (nonzero? (-> (the-as process-drawable arg0) root)) - (< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans)) - 61440.0 - ) - ) + (if (and (logtest? (process-mask enemy) (-> arg0 mask)) + (type-type? (-> arg0 type) process-drawable) + (nonzero? (-> (the-as process-drawable arg0) root)) + (< (vector-vector-distance (-> (the-as process-drawable arg0) root trans) (-> *target* control trans)) + 61440.0 + ) + ) (process-entity-status! arg0 (entity-perm-status bit-9) #t) ) ) diff --git a/test/decompiler/reference/engine/target/target-part_REF.gc b/test/decompiler/reference/engine/target/target-part_REF.gc index 6f89f7b253..ad72fcf358 100644 --- a/test/decompiler/reference/engine/target/target-part_REF.gc +++ b/test/decompiler/reference/engine/target/target-part_REF.gc @@ -37,14 +37,14 @@ ) (set! (-> a1-1 y) (+ 4096.0 (-> a1-1 y))) (when (>= (fill-and-probe-using-y-probe - *collide-cache* - a1-1 - (the-as float 20480.0) - (the-as uint #x2bef) - s5-0 - s3-0 - (the-as uint 1) - ) + *collide-cache* + a1-1 + (the-as float 20480.0) + (the-as uint #x2bef) + s5-0 + s3-0 + (the-as uint 1) + ) 0.0 ) (let ((s2-0 (new 'stack-no-clear 'vector)) diff --git a/test/decompiler/reference/engine/target/target-util_REF.gc b/test/decompiler/reference/engine/target/target-util_REF.gc index 4a1064868f..580b3c5ab3 100644 --- a/test/decompiler/reference/engine/target/target-util_REF.gc +++ b/test/decompiler/reference/engine/target/target-util_REF.gc @@ -770,15 +770,14 @@ (defun average-turn-angle ((arg0 target)) (let ((f30-0 0.0)) (dotimes (s5-0 8) - (+! - f30-0 - (fabs - (deg-diff - (atan (-> arg0 control unknown-vector-array00 s5-0 x) (-> arg0 control unknown-vector-array00 s5-0 z)) - 0.0 + (+! f30-0 + (fabs + (deg-diff + (atan (-> arg0 control unknown-vector-array00 s5-0 x) (-> arg0 control unknown-vector-array00 s5-0 z)) + 0.0 + ) ) ) - ) ) (* 0.125 f30-0) ) @@ -786,40 +785,36 @@ ;; definition for function can-play-stance-amibent? (defbehavior can-play-stance-amibent? target () - (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 9000) - (not (-> *setting-control* current talking)) - (not (-> *setting-control* current spooling)) - (not (-> *setting-control* current movie)) - (not (-> *setting-control* current hint)) - (zero? (logand (-> self control status) 32)) - (zero? (logand (-> self water flags) 512)) - ) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 9000) + (not (-> *setting-control* current talking)) + (not (-> *setting-control* current spooling)) + (not (-> *setting-control* current movie)) + (not (-> *setting-control* current hint)) + (zero? (logand (-> self control status) 32)) + (zero? (logand (-> self water flags) 512)) + ) ) ;; definition for function can-jump? (defbehavior can-jump? target ((arg0 symbol)) - (and - (or - (logtest? (-> self control status) 1) - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (and (logtest? (-> self control status) 1) (< 0.866 (-> self control surface-angle))) - ) - (and - (zero? (logand (-> self control unknown-surface01 flags) 64)) - (zero? (logand (-> self state-flags) 2048)) - (case arg0 - (('target-wheel-flip) - (>= 0.5 (-> self control unknown-float61)) - ) - (else - #t - ) - ) - ) - ) + (and (or (logtest? (-> self control status) 1) + (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (and (logtest? (-> self control status) 1) (< 0.866 (-> self control surface-angle))) + ) + (and (zero? (logand (-> self control unknown-surface01 flags) 64)) + (zero? (logand (-> self state-flags) 2048)) + (case arg0 + (('target-wheel-flip) + (>= 0.5 (-> self control unknown-float61)) + ) + (else + #t + ) + ) + ) + ) ) ;; definition for function move-legs? @@ -835,34 +830,30 @@ ;; definition for function fall-test ;; INFO: Return type mismatch object vs none. (defbehavior fall-test target () - (when (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-15 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or - (not (or - (= v1-15 (-> self draw art-group data 59)) - (= v1-15 (-> self draw art-group data 60)) - (= v1-15 (-> self draw art-group data 61)) - ) + (when (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-15 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-15 (-> self draw art-group data 59)) + (= v1-15 (-> self draw art-group data 60)) + (= v1-15 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) - (when (and - (< (- (-> *display* base-frame-counter) (the-as int (-> self control rider-time))) - (the-as int (-> *TARGET-bank* ground-timeout)) ) - (logtest? (-> self control unknown-surface01 flags) #x4000) - ) + ) + (when (and (< (- (-> *display* base-frame-counter) (the-as int (-> self control rider-time))) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (logtest? (-> self control unknown-surface01 flags) #x4000) + ) (+! (-> self control transv x) (-> self control rider-last-move x)) (+! (-> self control transv z) (-> self control rider-last-move z)) ) @@ -874,14 +865,13 @@ ;; definition for function slide-down-test ;; INFO: Return type mismatch object vs none. (defbehavior slide-down-test target () - (if (and - (zero? (logand (-> self control status) 129)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (logtest? (-> self control status) 4) - (< 0.5 (-> self control surface-angle)) - ) + (if (and (zero? (logand (-> self control status) 129)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (logtest? (-> self control status) 4) + (< 0.5 (-> self control surface-angle)) + ) (go target-slide-down) ) (none) @@ -889,35 +879,31 @@ ;; definition for function smack-surface? (defbehavior smack-surface? target ((arg0 symbol)) - (and (< 0.7 (-> self control touch-angle)) (and - (< (-> self control surface-angle) 0.3) - (logtest? (-> self control status) 8) - (or arg0 (zero? (logand (-> self control status) 32))) - ) + (and (< 0.7 (-> self control touch-angle)) (and (< (-> self control surface-angle) 0.3) + (logtest? (-> self control status) 8) + (or arg0 (zero? (logand (-> self control status) 32))) + ) ) ) ;; definition for function can-wheel? (defbehavior can-wheel? target () - (and - (logtest? (-> self control status) 1) - (or (zero? (logand (-> self control status) 8)) (>= 0.7 (-> self control touch-angle))) - (and (< (-> self control unknown-float61) 0.7) (zero? (logand (-> self state-flags) 8192))) - ) + (and (logtest? (-> self control status) 1) + (or (zero? (logand (-> self control status) 8)) (>= 0.7 (-> self control touch-angle))) + (and (< (-> self control unknown-float61) 0.7) (zero? (logand (-> self state-flags) 8192))) + ) ) ;; definition for function can-duck? (defbehavior can-duck? target () - (and - (logtest? (-> self control status) 1) - (>= (-> self control unknown-float60) 0.7) - (zero? (logand (-> self water flags) 6144)) - (zero? (logand (-> self state-flags) 8192)) - (or - (zero? (logand (-> self water flags) 1024)) - (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) - ) - ) + (and (logtest? (-> self control status) 1) + (>= (-> self control unknown-float60) 0.7) + (zero? (logand (-> self water flags) 6144)) + (zero? (logand (-> self state-flags) 8192)) + (or (zero? (logand (-> self water flags) 1024)) + (< (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) ) ;; definition for function can-exit-duck? @@ -951,43 +937,36 @@ ;; definition for function can-hands? (defbehavior can-hands? target ((arg0 symbol)) (cond - ((or - (zero? (logand - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) + ((or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) ) - ) - (or - (and - (logtest? (-> self state-flags) 4096) - (or - (zero? (logand (-> self state-flags) #x4000)) - (not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))) + (or (and (logtest? (-> self state-flags) 4096) + (or (zero? (logand (-> self state-flags) #x4000)) + (not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))) + ) + ) + (logtest? (-> self control unknown-surface01 flags) 384) ) - ) - (logtest? (-> self control unknown-surface01 flags) 384) ) - ) #f ) - ((and - (or (not arg0) (and - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (< (-> self control unknown-float61) 0.7) - ) - ) - (>= (- (-> *display* base-frame-counter) - (the-as int (if (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) - (-> *TARGET-bank* yellow-attack-timeout) - (-> *TARGET-bank* attack-timeout) - ) - ) - ) - (-> self control unknown-dword31) - ) - ) + ((and (or (not arg0) (and (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (< (-> self control unknown-float61) 0.7) + ) + ) + (>= (- (-> *display* base-frame-counter) + (the-as int (if (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (-> *TARGET-bank* yellow-attack-timeout) + (-> *TARGET-bank* attack-timeout) + ) + ) + ) + (-> self control unknown-dword31) + ) + ) #t ) (else diff --git a/test/decompiler/reference/engine/target/target2_REF.gc b/test/decompiler/reference/engine/target/target2_REF.gc index a27c768011..b39ce0d348 100644 --- a/test/decompiler/reference/engine/target/target2_REF.gc +++ b/test/decompiler/reference/engine/target/target2_REF.gc @@ -164,11 +164,9 @@ :trans (behavior () (spool-push *art-control* (-> self control unknown-spoolanim00 name) 0 self (the-as float -99.0)) - (if (or - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons start l1 r1 triangle circle x square) - ) + (if (or (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons start l1 r1 triangle circle x square) + ) *progress-process* ) (go target-stance) @@ -358,14 +356,18 @@ ;; failed to figure out what this is: (defstate hud-waiting (first-person-hud) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('go-away) - (go hud-going-out) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('go-away) + (go hud-going-out) + ) + ) + ) :enter - (behavior () (disable-hud (the-as int (-> *hud-parts* power))) (none)) + (behavior () + (disable-hud (the-as int (-> *hud-parts* power))) + (none) + ) :code (behavior () (while #t @@ -401,7 +403,10 @@ (none) ) :post - (behavior () (dumb-15 self) (none)) + (behavior () + (dumb-15 self) + (none) + ) ) ;; failed to figure out what this is: @@ -411,8 +416,7 @@ :code (behavior () (while #t - (if (or - (not *progress-process*) + (if (or (not *progress-process*) (= (-> *progress-process* 0 next-state name) 'progress-going-out) (= (-> *progress-process* 0 next-state name) 'progress-gone) ) @@ -445,7 +449,10 @@ (none) ) :post - (behavior () (dumb-15 self) (none)) + (behavior () + (dumb-15 self) + (none) + ) ) ;; definition for function part-first-person-hud-left-func @@ -538,11 +545,10 @@ (set! (-> a1-0 from) self) (set! (-> a1-0 num-params) 0) (set! (-> a1-0 message) 'dist-from-interp-src) - (and - (< (send-event-function *camera* a1-0) 4915.2) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 21) - (zero? (ja-group-size)) - ) + (and (< (send-event-function *camera* a1-0) 4915.2) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 21) + (zero? (ja-group-size)) + ) ) (suspend) ) @@ -638,21 +644,17 @@ (vf6 :class vf) ) (init-vf0-vector) - (when (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons r2 circle square) - ) - (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 150) - (not *pause-lock*) - ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons r2 circle square) + ) + (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 150) + (not *pause-lock*) + ) (let ((gp-1 (vector-float*! (new-stack-vector0) (-> *math-camera* inv-camera-rot vector 2) @@ -704,10 +706,9 @@ ) (set! (-> self control unknown-dword82) (-> *display* base-frame-counter)) ) - (when (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons triangle) - ) + (when (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons triangle) + ) (logclear! (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons triangle) @@ -827,21 +828,17 @@ (vf6 :class vf) ) (init-vf0-vector) - (when (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons r2 circle square) - ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 135) - (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) - (not *pause-lock*) - ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons r2 circle square) + ) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 135) + (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (not *pause-lock*) + ) (let ((gp-1 (vector-float*! (new-stack-vector0) (-> *math-camera* inv-camera-rot vector 2) @@ -897,7 +894,12 @@ ) ) :code - (behavior () (ja-channel-set! 0) (set! (-> self control transv quad) (the-as uint128 0)) (anim-loop) (none)) + (behavior () + (ja-channel-set! 0) + (set! (-> self control transv quad) (the-as uint128 0)) + (anim-loop) + (none) + ) :post target-no-move-post ) @@ -951,7 +953,11 @@ (none) ) :exit - (behavior () (set! (-> self state-flags) (logand -17 (-> self state-flags))) (target-exit) (none)) + (behavior () + (set! (-> self state-flags) (logand -17 (-> self state-flags))) + (target-exit) + (none) + ) :code (behavior () (set-forward-vel (the-as float (-> (new 'static 'array int32 1 0) 0))) @@ -962,19 +968,18 @@ (suspend) ) (if (or (> gp-0 0) (let ((v1-11 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or - (= v1-11 (-> self draw art-group data 34)) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-11 (-> self draw art-group data 34)) (= v1-11 (-> self draw art-group data 38)) (= v1-11 (-> self draw art-group data 42)) (= v1-11 (-> self draw art-group data 43)) (= v1-11 (-> self draw art-group data 41)) ) - ) - ) + ) + ) (target-hit-ground-anim #f) ) ) @@ -984,28 +989,25 @@ (case gp-1 (('stance) (cond - ((or - (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + ((or (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 23) ) - (-> self draw art-group data 23) - ) - (< 0.5 (-> self skel root-channel 6 frame-interp)) - ) - (let ((v1-32 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or - (= v1-32 (-> self draw art-group data 28)) - (= v1-32 (-> self draw art-group data 29)) - (= v1-32 (-> self draw art-group data 54)) - (= v1-32 (-> self draw art-group data 55)) + (< 0.5 (-> self skel root-channel 6 frame-interp)) + ) + (let ((v1-32 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-32 (-> self draw art-group data 28)) + (= v1-32 (-> self draw art-group data 29)) + (= v1-32 (-> self draw art-group data 54)) + (= v1-32 (-> self draw art-group data 55)) + ) ) ) - ) (ja-channel-push! 1 45) (let ((a0-39 (-> self skel root-channel 0))) (set! (-> a0-39 frame-group) (the-as art-joint-anim (-> self draw art-group data 4))) @@ -1048,10 +1050,9 @@ ) ) ) - (and - (or (= v1-87 (-> self draw art-group data 39)) (= v1-87 (-> self draw art-group data 35))) - (not (ja-max? 0)) - ) + (and (or (= v1-87 (-> self draw art-group data 39)) (= v1-87 (-> self draw art-group data 35))) + (not (ja-max? 0)) + ) ) (let ((a0-54 (-> self skel root-channel 0))) (set! (-> a0-54 param 0) (the float (+ (-> a0-54 frame-group data 0 length) -1))) @@ -1064,14 +1065,13 @@ ) (ja-channel-push! 1 22) ) - ((not (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) + ((not (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) + (= (ja-group-size) 1) ) - (= (ja-group-size) 1) - ) ) (ja-channel-push! 1 22) ) @@ -1128,11 +1128,11 @@ ) (('shock-out) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 88) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 88) + ) + ) (ja-channel-push! 1 60) ) (let ((s5-2 (-> self skel root-channel 0))) @@ -1204,20 +1204,16 @@ ) :trans (behavior () - (when (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (zero? (logand (-> self state-flags) 2048)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (zero? (logand (-> self state-flags) 2048)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + ) (set! (-> self control transv quad) (the-as uint128 0)) (cond ((< 44.0 (ja-aframe-num 0)) @@ -1265,8 +1261,8 @@ ) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 83) ) (while (not (-> self control unknown-int21)) @@ -1536,25 +1532,20 @@ ) :trans (behavior () - (when (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (zero? (logand (-> self state-flags) 2048)) - ) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) + (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (zero? (logand (-> self state-flags) 2048)) + ) (cond - ((or - (< -0.2 (local-pad-angle)) - (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - ) + ((or (< -0.2 (local-pad-angle)) + (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + ) (let ((a1-2 (new 'stack-no-clear 'collide-using-spheres-params))) (set! (-> a1-2 spheres) (the-as (pointer sphere) (-> *collide-edge-work* world-player-leap-up-spheres))) (set! (-> a1-2 num-spheres) (the-as uint 6)) @@ -1592,8 +1583,8 @@ ) (while (< 0.0 (-> self control unknown-float110)) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 38) ) ) @@ -1787,13 +1778,11 @@ (set! (-> self control transv quad) (the-as uint128 0)) (set! (-> self control root-prim prim-core action) (logand -137 (-> self control root-prim prim-core action))) (vector-float*! (-> self control transv) (-> self control unknown-vector101) -40960.0) - (when (and - (< (- (-> *display* base-frame-counter) (the-as int (-> self control rider-time))) 60) - (or - (logtest? (-> self control unknown-surface01 flags) #x4000) - (= (-> self control poly-pat material) (pat-material rotate)) - ) - ) + (when (and (< (- (-> *display* base-frame-counter) (the-as int (-> self control rider-time))) 60) + (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (= (-> self control poly-pat material) (pat-material rotate)) + ) + ) (+! (-> self control transv x) (-> self control rider-last-move x)) (+! (-> self control transv z) (-> self control rider-last-move z)) ) @@ -1927,8 +1916,7 @@ (joint-control-channel-group! s5-3 (the-as art-joint-anim (-> self draw art-group data 84)) num-func-seek!) ) (until (ja-done? 0) - (if (or - (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) + (if (or (< (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) (the-as uint 30) ) (= (-> self control unknown-uint31) 1) @@ -2114,7 +2102,10 @@ :exit target-exit :trans - (behavior () (slide-down-test) (none)) + (behavior () + (slide-down-test) + (none) + ) :code (behavior ((arg0 object) (arg1 float)) (set! (-> self neck flex-blend) 0.0) @@ -2147,29 +2138,23 @@ (joint-control-channel-group! s5-0 (the-as art-joint-anim (-> self draw art-group data 87)) num-func-seek!) ) (until (ja-done? 0) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self state-flags) 2048)) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack-air #f) ) (when (can-hands? #f) @@ -2233,49 +2218,40 @@ :trans (behavior () ((-> self state-hook)) - (when (and - (zero? (logand (-> self water flags) 1024)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self water wade-time))) 15) - ) + (when (and (zero? (logand (-> self water flags) 1024)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self water wade-time))) 15) + ) (if (logtest? (-> self water flags) 2048) (go target-swim-stance) (go target-stance) ) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (go target-duck-stance) ) (if (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-wade-walk) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) @@ -2302,10 +2278,9 @@ :trans (behavior () ((-> self state-hook)) - (when (and - (zero? (logand (-> self water flags) 1024)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self water wade-time))) 30) - ) + (when (and (zero? (logand (-> self water flags) 1024)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self water wade-time))) 30) + ) (if (logtest? (-> self water flags) 2048) (go target-swim-stance) (go target-stance) @@ -2314,37 +2289,29 @@ (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-wade-stance) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (go target-duck-walk) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (sound-play-by-name (static-sound-name "swim-stroke") (new-sound-id) 1024 0 0 1 #t) (dummy-13 (-> self water) (the-as float 1.4) (-> self control trans) 0 (-> self control transv)) (go target-attack) @@ -2379,8 +2346,8 @@ (set! gp-0 30) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 92) ) (set! gp-0 120) @@ -2389,8 +2356,8 @@ ) (cond ((and (= (ja-group-size) 6) (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 89) ) ) @@ -2567,10 +2534,9 @@ (set! (-> a0-69 param 0) 0.0) (joint-control-channel-group-eval! a0-69 (the-as art-joint-anim #f) num-func-chan) ) - (when (and - (>= (- (-> *display* base-frame-counter) gp-6) 60) - (< (- (-> self water height) (-> self control trans y)) 4096.0) - ) + (when (and (>= (- (-> *display* base-frame-counter) gp-6) 60) + (< (- (-> self water height) (-> self control trans y)) 4096.0) + ) (case (the int (ja-aframe-num 0)) ((15 16 17 18) (dummy-13 @@ -2666,12 +2632,11 @@ (target-state-hook-exit) (set! (-> self control unknown-surface00 target-speed) 28672.0) (target-exit) - (when (not (or - (= (-> self next-state name) 'target-swim-stance) - (= (-> self next-state name) 'target-swim-walk) - (= (-> self next-state name) 'target-swim-down) - (= (-> self next-state name) 'target-swim-up) - ) + (when (not (or (= (-> self next-state name) 'target-swim-stance) + (= (-> self next-state name) 'target-swim-walk) + (= (-> self next-state name) 'target-swim-down) + (= (-> self next-state name) 'target-swim-up) + ) ) (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) @@ -2684,60 +2649,50 @@ (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) (set-zero! (-> self water bob)) ) - (when (and - (zero? (logand (-> self water flags) 2048)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - ) + (when (and (zero? (logand (-> self water flags) 2048)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + ) (if (logtest? (-> self water flags) 1024) (go target-wade-stance) (go target-stance) ) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self water enter-swim-time))) 30) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self water enter-swim-time))) 30) + ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons square) - ) - (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) (go target-swim-down) ) - (if (and - (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (let ((gp-0 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (ja-aframe-num 0) - (if (or (and (= gp-0 (-> self draw art-group data 96)) #t) (and (= gp-0 (-> self draw art-group data 95)) #t)) - #f - #t - ) - ) - ) + (if (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (let ((gp-0 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (ja-aframe-num 0) + (if (or (and (= gp-0 (-> self draw art-group data 96)) #t) (and (= gp-0 (-> self draw art-group data 95)) #t)) + #f + #t + ) + ) + ) (go target-swim-walk) ) (target-swim-tilt @@ -2790,8 +2745,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 92) ) (ja-channel-push! 1 249) @@ -2846,51 +2801,42 @@ (if (and (logtest? (-> self control status) 1) (zero? (logand (-> self control status) 1024))) (set-zero! (-> self water bob)) ) - (when (and - (zero? (logand (-> self water flags) 2048)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self water swim-time))) 30) - ) + (when (and (zero? (logand (-> self water flags) 2048)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self water swim-time))) 30) + ) (if (logtest? (-> self water flags) 1024) (go target-wade-stance) (go target-stance) ) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self water enter-swim-time))) 30) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self water enter-swim-time))) 30) + ) (go target-swim-jump (-> *TARGET-bank* swim-jump-height-min) (-> *TARGET-bank* swim-jump-height-max)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons square) - ) - (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (< (-> *TARGET-bank* min-dive-depth) (target-height-above-ground)) + ) (go target-swim-down) ) (cond ((= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (if (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 15) - ) + (the-as uint 15) + ) (go target-swim-stance) ) ) @@ -2914,16 +2860,15 @@ ) ) (cond - ((or - (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) - (= v1-2 (-> self draw art-group data 97)) - ) + ((or (= v1-2 (-> self draw art-group data 96)) + (= v1-2 (-> self draw art-group data 95)) + (= v1-2 (-> self draw art-group data 97)) + ) (ja-channel-push! 1 90) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 97) ) (ja-channel-push! 1 45) @@ -3026,12 +2971,11 @@ (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) (target-exit) - (when (not (or - (= (-> self next-state name) 'target-swim-stance) - (= (-> self next-state name) 'target-swim-walk) - (= (-> self next-state name) 'target-swim-down) - (= (-> self next-state name) 'target-swim-up) - ) + (when (not (or (= (-> self next-state name) 'target-swim-stance) + (= (-> self next-state name) 'target-swim-walk) + (= (-> self next-state name) 'target-swim-down) + (= (-> self next-state name) 'target-swim-up) + ) ) (quaternion-identity! (-> self control unknown-quaternion01)) (set! (-> self control unknown-float00) 0.0) @@ -3082,13 +3026,12 @@ ) (set! f30-0 (cond - ((or - (= v1-2 (-> self draw art-group data 91)) - (= v1-2 (-> self draw art-group data 92)) - (= v1-2 (-> self draw art-group data 97)) - (= v1-2 (-> self draw art-group data 96)) - (= v1-2 (-> self draw art-group data 95)) - ) + ((or (= v1-2 (-> self draw art-group data 91)) + (= v1-2 (-> self draw art-group data 92)) + (= v1-2 (-> self draw art-group data 97)) + (= v1-2 (-> self draw art-group data 96)) + (= v1-2 (-> self draw art-group data 95)) + ) (ja-channel-push! 1 22) (let ((a0-17 (-> self skel root-channel 0))) (set! (-> a0-17 frame-group) (the-as art-joint-anim (-> self draw art-group data 93))) @@ -3161,28 +3104,22 @@ ) ) (while #t - (if (and - (or - (zero? (logand - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) - (-> self control unknown-spoolanim00) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - ) + (if (and (or (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + (-> self control unknown-spoolanim00) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + ) (go target-swim-up) ) - (if (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) - (and - (logtest? (-> self control status) 1) - (and - (< (-> self water swim-depth) 8192.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) - ) - ) + (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) s5-0) + (and (logtest? (-> self control status) 1) + (and (< (-> self water swim-depth) 8192.0) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) + ) + ) ) (go target-swim-up) ) @@ -3235,11 +3172,10 @@ (-> target-swim-down exit) :trans (behavior () - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) - (zero? (logand (-> self state-flags) 2048)) - (zero? (logand (-> self water flags) #x6000)) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (zero? (logand (-> self state-flags) 2048)) + (zero? (logand (-> self water flags) #x6000)) + ) (go target-swim-jump-jump (-> *TARGET-bank* swim-jump-height-min) @@ -3247,10 +3183,9 @@ (the-as surface #f) ) ) - (when (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 3000) - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - ) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 3000) + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + ) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-1 from) self) (set! (-> a1-1 num-params) 2) @@ -3291,16 +3226,13 @@ (the-as float (-> (new 'static 'array int32 1 0) 0)) (the-as float 0.1) ) - (if (and - (zero? (logand (-> self water flags) 4096)) - (or - (>= (ja-aframe-num 0) 222.0) - (and - (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (>= (ja-aframe-num 0) 200.0) - ) - ) - ) + (if (and (zero? (logand (-> self water flags) 4096)) + (or (>= (ja-aframe-num 0) 222.0) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (>= (ja-aframe-num 0) 200.0) + ) + ) + ) (goto cfg-37) ) (TODO-RENAME-9 (-> self align)) @@ -3596,10 +3528,9 @@ (until (>= (- (-> *display* base-frame-counter) sv-32) arg1) (let ((s4-0 (ppointer->process (-> self parent)))) (cond - ((and - sv-44 - (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) - ) + ((and sv-44 + (< (- (-> (the-as target s4-0) control trans y) (-> (the-as target s4-0) control unknown-vector52 y)) arg2) + ) (vector-xz-normalize! (-> (the-as target s4-0) control transv) (the-as float (-> (new 'static 'array int32 1 0) 0)) @@ -3618,10 +3549,9 @@ (set! sv-32 (-> *display* base-frame-counter)) ) (set! sv-44 (the-as symbol #f)) - (when (or - (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) - (= (-> (the-as target s4-0) next-state name) 'target-falling) - ) + (when (or (= (-> (the-as target s4-0) next-state name) 'target-duck-high-jump-jump) + (= (-> (the-as target s4-0) next-state name) 'target-falling) + ) (let ((v1-30 (-> (the-as target s4-0) control trans)) (s3-0 (-> (the-as target s4-0) control transv)) ) @@ -3773,7 +3703,11 @@ (none) ) :exit - (behavior () (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) (target-exit) (none)) + (behavior () + (send-event (handle->process (-> self control unknown-handle10)) 'end-mode) + (target-exit) + (none) + ) :code (behavior ((arg0 string) (arg1 handle)) (let ((gp-0 (the-as art-joint-anim (dummy-10 (-> self draw art-group) arg0 art-joint-anim)))) diff --git a/test/decompiler/reference/engine/target/target_REF.gc b/test/decompiler/reference/engine/target/target_REF.gc index 069edcffc7..87d50507d3 100644 --- a/test/decompiler/reference/engine/target/target_REF.gc +++ b/test/decompiler/reference/engine/target/target_REF.gc @@ -38,8 +38,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 50) ) (until (ja-done? 0) @@ -53,8 +53,8 @@ (ja-channel-push! 1 45) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 86) ) (ja-channel-push! 1 45) @@ -116,48 +116,40 @@ ;; definition for function target-falling-trans ;; INFO: Return type mismatch int vs none. (defbehavior target-falling-trans target ((arg0 basic) (arg1 cpad-list)) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack-air #f) ) (when (= arg0 'target-eco-powerup) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (zero? (logand (-> self water flags) 512)) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 900) - (zero? (logand (-> self state-flags) 2048)) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (zero? (logand (-> self water flags) 512)) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 900) + (zero? (logand (-> self state-flags) 2048)) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) ) (if (logtest? (-> self control status) 1) (go target-hit-ground #f) ) - (when (if (and - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - (>= (the-as int arg1) 0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int arg1)) - (not - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) - ) - ) + (when (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (>= (the-as int arg1) 0) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int arg1)) + (not + (and *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) #t ) (logior! (-> self control status) 1) @@ -178,16 +170,14 @@ ) ) (cond - ((or - (= v1-2 (-> self draw art-group data 63)) - (= v1-2 (-> self draw art-group data 64)) - (= v1-2 (-> self draw art-group data 66)) - (= v1-2 (-> self draw art-group data 67)) - ) - (let ((gp-0 (or - (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (< (-> self control unknown-float01) (-> (new 'static 'array float 1 61440.0) 0)) - ) + ((or (= v1-2 (-> self draw art-group data 63)) + (= v1-2 (-> self draw art-group data 64)) + (= v1-2 (-> self draw art-group data 66)) + (= v1-2 (-> self draw art-group data 67)) + ) + (let ((gp-0 (or (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (< (-> self control unknown-float01) (-> (new 'static 'array float 1 61440.0) 0)) + ) ) (f30-0 (if (= arg0 'swim) (-> (new 'static 'array float 1 0.4) 0) @@ -204,14 +194,14 @@ ) ) (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if gp-0 - (-> self draw art-group data 65) - (-> self draw art-group data 68) - ) - ) - data - 0 - length - ) + (-> self draw art-group data 65) + (-> self draw art-group data 68) + ) + ) + data + 0 + length + ) -1 ) ) @@ -240,17 +230,15 @@ (-> (new 'static 'array float 1 1.0) 0) (the-as float 1.5) ) - (when (and (>= 25.0 (ja-aframe-num 0)) (and - (>= (ja-aframe-num 0) 21.0) - (= (-> self next-state name) 'target-flop-hit-ground) - (!= (-> self control unknown-spoolanim00) 'stuck) - ) + (when (and (>= 25.0 (ja-aframe-num 0)) (and (>= (ja-aframe-num 0) 21.0) + (= (-> self next-state name) 'target-flop-hit-ground) + (!= (-> self control unknown-spoolanim00) 'stuck) + ) ) (set! (-> self event-hook) target-jump-event-handler) - (when (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - (can-jump? #f) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (can-jump? #f) + ) (ja-channel-set! 0) (go target-high-jump @@ -276,10 +264,9 @@ ) #f ) - ((and - (= (-> self control ground-pat material) (pat-material ice)) - (< 16384.0 (-> self control unknown-float01)) - ) + ((and (= (-> self control ground-pat material) (pat-material ice)) + (< 16384.0 (-> self control unknown-float01)) + ) #f ) ((let ((v1-95 (if (> (-> self skel active-channels) 0) @@ -287,21 +274,18 @@ ) ) ) - (or - (or - (= v1-95 (-> self draw art-group data 38)) - (= v1-95 (-> self draw art-group data 42)) - (= v1-95 (-> self draw art-group data 43)) - ) - (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (or (or (= v1-95 (-> self draw art-group data 38)) + (= v1-95 (-> self draw art-group data 42)) + (= v1-95 (-> self draw art-group data 43)) + ) + (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) ) - (-> self draw art-group data 34) - ) - (>= (ja-aframe-num 0) 38.0) + (>= (ja-aframe-num 0) 38.0) + ) ) - ) ) (ja-channel-push! 1 6) (let ((a0-35 (-> self skel root-channel 0))) @@ -323,14 +307,13 @@ ) #f ) - ((and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) + ((and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) + ) + (>= (ja-aframe-num 0) 35.0) ) - (>= (ja-aframe-num 0) 35.0) - ) (ja-channel-set! 1) (let ((a0-44 (-> self skel root-channel 0))) (set! (-> a0-44 frame-group) (the-as art-joint-anim (-> self draw art-group data 39))) @@ -420,10 +403,10 @@ (or (= v1-242 (-> self draw art-group data 73)) (= v1-242 (-> self draw art-group data 74))) ) (let ((f30-2 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 74) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 74) + ) (-> (new 'static 'array float 1 24576.0) 0) (-> (new 'static 'array float 1 -24576.0) 0) ) @@ -473,15 +456,14 @@ ) ) ) - (or - (= v1-305 (-> self draw art-group data 34)) - (= v1-305 (-> self draw art-group data 56)) - (= v1-305 (-> self draw art-group data 57)) - (= v1-305 (-> self draw art-group data 58)) - (= v1-305 (-> self draw art-group data 68)) - (= v1-305 (-> self draw art-group data 65)) - (= v1-305 (-> self draw art-group data 62)) - ) + (or (= v1-305 (-> self draw art-group data 34)) + (= v1-305 (-> self draw art-group data 56)) + (= v1-305 (-> self draw art-group data 57)) + (= v1-305 (-> self draw art-group data 58)) + (= v1-305 (-> self draw art-group data 68)) + (= v1-305 (-> self draw art-group data 65)) + (= v1-305 (-> self draw art-group data 62)) + ) ) (ja-channel-push! 1 12) (let ((gp-6 (-> self skel root-channel 0))) @@ -504,8 +486,8 @@ #f ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 35) ) (let ((a0-119 (-> self skel root-channel 0))) @@ -528,7 +510,12 @@ :event target-standard-event-handler :code - (behavior () (suspend) (suspend) (go target-stance) (none)) + (behavior () + (suspend) + (suspend) + (go target-stance) + (none) + ) :post target-no-move-post ) @@ -544,7 +531,11 @@ (none) ) :exit - (behavior () (set! (-> self control unknown-float81) 0.0) (target-state-hook-exit) (none)) + (behavior () + (set! (-> self control unknown-float81) 0.0) + (target-state-hook-exit) + (none) + ) :trans (behavior () ((-> self state-hook)) @@ -561,45 +552,35 @@ (remove-exit) (go target-walk) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (set! (-> self control unknown-float81) 0.0) (remove-exit) (go target-duck-stance) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) @@ -624,8 +605,8 @@ (set! s5-0 45) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 71) ) (let ((a0-12 (-> self skel root-channel 0))) @@ -647,8 +628,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 51) ) (cond @@ -693,8 +674,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 78) ) (let ((a0-30 (-> self skel root-channel 0))) @@ -716,8 +697,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 84) ) (let ((a0-37 (-> self skel root-channel 0))) @@ -740,8 +721,8 @@ (set! s5-0 0) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 59) ) (set! (-> self control unknown-float81) (-> self control unknown-float80)) @@ -754,14 +735,14 @@ ) ) (set! (-> s4-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? (the-as float 0.3)) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + data + 0 + length + ) -1 ) ) @@ -824,32 +805,29 @@ ) (set! s5-0 12) ) - ((or - (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) - ) - (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp))) - ) - (let ((v1-243 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + ((or (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) ) - ) - (or - (= v1-243 (-> self draw art-group data 28)) - (= v1-243 (-> self draw art-group data 29)) - (= v1-243 (-> self draw art-group data 54)) - (= v1-243 (-> self draw art-group data 55)) + (-> self draw art-group data 23) + ) + (begin (set! s5-0 45) (< 0.5 (-> self skel root-channel 6 frame-interp))) + ) + (let ((v1-243 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-243 (-> self draw art-group data 28)) + (= v1-243 (-> self draw art-group data 29)) + (= v1-243 (-> self draw art-group data 54)) + (= v1-243 (-> self draw art-group data 55)) + ) ) ) - ) (let ((f30-1 (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 23) ) (let ((f0-57 (+ 50.0 (* 0.8333333 (+ -25.0 (ja-aframe-num 0)))))) @@ -936,27 +914,25 @@ ) ) ) - ((and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) + ((and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 23) + ) + (>= (-> self control unknown-float01) 5734.4) ) - (>= (-> self control unknown-float01) 5734.4) - ) (set! s5-0 45) ) ) ) - (if (not (and - (= (if (> (-> self skel active-channels) 0) + (if (not (and (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) ) - (-> self draw art-group data 5) - ) - (= (ja-group-size) 3) - ) - ) + (-> self draw art-group data 5) + ) + (= (ja-group-size) 3) + ) + ) (ja-channel-push! 3 s5-0) ) (ground-tween-initialize @@ -1005,7 +981,11 @@ (none) ) :exit - (behavior () (target-effect-exit) (target-state-hook-exit) (none)) + (behavior () + (target-effect-exit) + (target-state-hook-exit) + (none) + ) :trans (behavior () ((-> self state-hook)) @@ -1014,33 +994,26 @@ (remove-exit) (go target-ice-walk) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (and (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) + (-> self control unknown-dword30) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons l1 r1) - ) - (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) - (-> self control unknown-dword30) - ) - (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) - ) - ) + ) (go target-wheel) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (target-effect-exit) (remove-exit) (go target-duck-walk) @@ -1050,34 +1023,26 @@ (remove-exit) (go target-stance) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) @@ -1107,24 +1072,24 @@ ) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 33) ) (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) (ja-channel-push! 7 15) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 69) ) (ja-channel-push! 7 22) (set! f30-0 (-> (new 'static 'array float 1 1.0) 0)) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 51) ) (let ((f30-1 @@ -1229,27 +1194,26 @@ (set! f28-0 26.0) (ja-channel-push! 7 30) ) - ((and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 23) + ((and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 23) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) (set! f28-0 (ja-aframe-num 0)) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 102) ) (set! f28-0 (ja-aframe-num 0)) (ja-channel-push! 7 30) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 89) ) (set! f28-0 (ja-aframe-num 0)) @@ -1260,27 +1224,23 @@ ) ) ) - (and - (or - (or - (= v1-146 (-> self draw art-group data 38)) - (= v1-146 (-> self draw art-group data 71)) - (= v1-146 (-> self draw art-group data 58)) - (= v1-146 (-> self draw art-group data 62)) - (= v1-146 (-> self draw art-group data 65)) - (= v1-146 (-> self draw art-group data 68)) - ) - (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (and (or (or (= v1-146 (-> self draw art-group data 38)) + (= v1-146 (-> self draw art-group data 71)) + (= v1-146 (-> self draw art-group data 58)) + (= v1-146 (-> self draw art-group data 62)) + (= v1-146 (-> self draw art-group data 65)) + (= v1-146 (-> self draw art-group data 68)) + ) + (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) + ) + (< 30.0 (ja-aframe-num 0)) ) - (-> self draw art-group data 34) ) - (< 30.0 (ja-aframe-num 0)) - ) - ) - (< 12288.0 (-> self control unknown-float01)) - ) + (< 12288.0 (-> self control unknown-float01)) + ) ) (let ((s5-4 (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) @@ -1300,9 +1260,9 @@ ) (cond ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 77824.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + (-> (new 'static 'array float 1 77824.0) 0) + (-> (new 'static 'array float 1 102400.0) 0) + ) f30-2 ) (let ((s5-5 (-> self skel root-channel 0))) @@ -1322,9 +1282,9 @@ ) ) ((< (if (= s5-4 (-> self draw art-group data 34)) - (-> (new 'static 'array float 1 61440.0) 0) - (-> (new 'static 'array float 1 102400.0) 0) - ) + (-> (new 'static 'array float 1 61440.0) 0) + (-> (new 'static 'array float 1 102400.0) 0) + ) f30-2 ) (let ((s5-7 (-> self skel root-channel 0))) @@ -1379,16 +1339,16 @@ (ja-channel-set! 7) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 34) ) (ja-channel-push! 7 15) (set! gp-0 #t) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 78) ) (ja-channel-push! 7 45) @@ -1623,37 +1583,30 @@ :trans (behavior () ((-> self state-hook)) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) (go target-running-attack) ) - (if (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 24) - ) + (if (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 24) + ) (go target-falling #f) ) (slide-down-test) @@ -1705,17 +1658,22 @@ :event target-walk-event-handler :enter - (behavior () (set! (-> self control unknown-surface00) *jump-mods*) (none)) + (behavior () + (set! (-> self control unknown-surface00) *jump-mods*) + (none) + ) :exit - (behavior () (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self control unknown-dword35) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () - (when (or - (logtest? (-> self control status) 1) - (if (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - #t - ) - ) + (when (or (logtest? (-> self control status) 1) + (if (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + #t + ) + ) (logior! (-> self control status) 1) (go target-duck-stance) ) @@ -1724,11 +1682,11 @@ :code (behavior () (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 31) + ) + ) (ja-channel-push! 1 30) ) (while #t @@ -1772,10 +1730,9 @@ (set! arg0 (+ arg0 f0-1)) (set! arg1 (+ arg1 f0-1)) ) - (when (or - (logtest? (-> self control unknown-surface01 flags) #x4000) - (= (-> self control poly-pat material) (pat-material rotate)) - ) + (when (or (logtest? (-> self control unknown-surface01 flags) #x4000) + (= (-> self control poly-pat material) (pat-material rotate)) + ) (+! (-> self control transv x) (-> self control rider-last-move x)) (+! (-> self control transv z) (-> self control rider-last-move z)) ) @@ -1846,19 +1803,19 @@ (f26-0 f28-0) (f0-13 (- (sqrtf - (* 2.0 - (-> self control dynam gravity-length) - (- (lerp-scale - (the-as float (-> self control unknown-uint20)) - (the-as float (-> self control unknown-uint30)) - f30-0 - (-> (new 'static 'array float 1 0.0) 0) - (-> (new 'static 'array float 1 1.0) 0) - ) - (vector-dot (-> self control dynam gravity-normal) s3-1) - ) - ) - ) + (* 2.0 + (-> self control dynam gravity-length) + (- (lerp-scale + (the-as float (-> self control unknown-uint20)) + (the-as float (-> self control unknown-uint30)) + f30-0 + (-> (new 'static 'array float 1 0.0) 0) + (-> (new 'static 'array float 1 1.0) 0) + ) + (vector-dot (-> self control dynam gravity-normal) s3-1) + ) + ) + ) (* 0.008333334 (- (-> self control dynam gravity-length))) ) ) @@ -1875,24 +1832,22 @@ ) ) 0 - (when (and - arg1 - (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (and - (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (when (and arg1 + (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (and (-> (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + extra ) - extra - ) - #t - ) - ) + #t + ) + ) (let ((v1-57 (res-lump-struct (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) extra ) 'collide-offset @@ -1930,14 +1885,13 @@ ) :exit (behavior () - (if (not (or - (= (-> self next-state name) 'target-duck-walk) + (if (not (or (= (-> self next-state name) 'target-duck-walk) (= (-> self next-state name) 'target-duck-stance) (= (-> self next-state name) 'target-walk) (= (-> self next-state name) 'target-stance) (= (-> self next-state name) 'target-stance-look-around) ) - ) + ) (target-state-hook-exit) ) (target-exit) @@ -1947,42 +1901,35 @@ :trans (behavior () ((-> self state-hook)) - (if (and - (or - (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) - ) - (let ((v1-13 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (and - (not (or (= v1-13 (-> self draw art-group data 70)) (= v1-13 (-> self draw art-group data 69)))) - (can-exit-duck?) - ) - ) - ) + (if (and (or (zero? + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) 8192) + ) + (let ((v1-13 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (and (not (or (= v1-13 (-> self draw art-group data 70)) (= v1-13 (-> self draw art-group data 69)))) + (can-exit-duck?) + ) + ) + ) (go target-stance) ) (if (move-legs?) (go target-duck-walk) ) - (when (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) @@ -2003,8 +1950,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 69) ) (let ((a0-4 (-> self skel root-channel 0))) @@ -2025,18 +1972,17 @@ ) ) ) - ((and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 31) + ((and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 31) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 32) ) (ja-channel-push! 1 30) @@ -2096,11 +2042,11 @@ (set! (-> self control unknown-float81) (-> (new 'static 'array float 1 1.0) 0)) (target-collide-set! 'duck (-> (new 'static 'array float 1 1.0) 0)) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 69) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 69) + ) + ) (set! (-> self control unknown-surface00) *duck-mods*) ) (none) @@ -2110,37 +2056,30 @@ :trans (behavior () ((-> self state-hook)) - (if (and - (or - (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) - (logtest? (-> self state-flags) 8192) - (and - (logtest? (-> self water flags) 1024) - (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) - ) - ) - (can-exit-duck?) - ) + (if (and (or (zero? + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) + (logtest? (-> self state-flags) 8192) + (and (logtest? (-> self water flags) 1024) + (>= (- (- (-> self control trans y) (- (-> self water base-height) (-> self water wade-height)))) 2457.6) + ) + ) + (can-exit-duck?) + ) (go target-walk) ) (if (not (move-legs?)) (go target-duck-stance) ) - (when (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (when (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (if (= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (go target-high-jump (-> *TARGET-bank* duck-jump-height-min) (-> *TARGET-bank* duck-jump-height-max) 'duck) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) @@ -2160,18 +2099,17 @@ :code (behavior () (cond - ((and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 32) + ((and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 32) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 31) ) (ja-channel-push! 1 135) @@ -2311,41 +2249,36 @@ ) ) (target-falling-trans #f (the-as cpad-list (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 38) + ) 15 -1 ) ) ) - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) - ) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 12288.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self state-flags) 2048)) + ) + ) (go target-double-jump (-> *TARGET-bank* double-jump-height-min) (-> *TARGET-bank* double-jump-height-max)) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 26624.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + ) (go target-flop (the-as float 65502.96) @@ -2533,30 +2466,27 @@ :trans (behavior () (target-falling-trans #f (the-as cpad-list (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 38) + ) 15 -1 ) ) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + ) (go target-flop (the-as float 33775.48) @@ -2677,36 +2607,31 @@ :trans (behavior () (target-falling-trans #f (the-as cpad-list (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 38) + ) 15 -1 ) ) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 73728.0) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) - ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + ) (go target-flop (the-as float 33775.48) @@ -2757,15 +2682,14 @@ target-exit :code (behavior ((arg0 float) (arg1 float) (arg2 symbol)) - (if (not (and - (= (if (> (-> self skel active-channels) 0) + (if (not (and (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) ) - (-> self draw art-group data 31) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) - ) + (-> self draw art-group data 31) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) (ja-channel-push! 1 12) ) (case arg2 @@ -2950,7 +2874,10 @@ (none) ) :code - (behavior ((arg0 symbol)) (target-falling-anim -1 99) (none)) + (behavior ((arg0 symbol)) + (target-falling-anim -1 99) + (none) + ) :post (the-as (function none :behavior target) target-post) ) @@ -3019,19 +2946,15 @@ ) :trans (behavior () - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (if (and (not (can-exit-duck?)) (can-duck?)) @@ -3043,25 +2966,20 @@ (go target-walk) ) ) - (if (and - (or - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (not (can-exit-duck?)) - ) - (can-duck?) - ) + (if (and (or (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (not (can-exit-duck?)) + ) + (can-duck?) + ) (go target-duck-stance) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) @@ -3072,7 +2990,11 @@ (none) ) :code - (behavior ((arg0 symbol)) (target-hit-ground-anim #f) (go target-stance) (none)) + (behavior ((arg0 symbol)) + (target-hit-ground-anim #f) + (go target-stance) + (none) + ) :post (the-as (function none :behavior target) target-post) ) @@ -3092,7 +3014,11 @@ (none) ) :exit - (behavior () (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) (target-exit) (none)) + (behavior () + (set! (-> self control unknown-dword33) (-> *display* base-frame-counter)) + (target-exit) + (none) + ) :code (behavior () (ja-channel-push! 1 15) @@ -3106,10 +3032,9 @@ (joint-control-channel-group! a0-1 (the-as art-joint-anim (-> self draw art-group data 51)) num-func-seek!) ) (until (ja-done? 0) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 74) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 30) (level-hint-spawn @@ -3120,19 +3045,15 @@ (game-task none) ) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) (suspend) @@ -3161,15 +3082,14 @@ (-> self control) (the-as uint 224) ) - (let ((gp-1 - (target-send-attack - arg0 - (the-as uint (-> self control unknown-symbol30)) - (-> arg3 param 0) - (-> self control unknown-dword50) - (-> self control unknown-dword51) - ) - ) + (let ((gp-1 (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) ) (when gp-1 (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) @@ -3185,13 +3105,10 @@ ) ) ) - (if (and - v1-11 - (or - (logtest? (-> v1-11 root-prim prim-core collide-as) 256) - (logtest? (-> v1-11 root-prim prim-core action) 1024) - ) - ) + (if (and v1-11 (or (logtest? (-> v1-11 root-prim prim-core collide-as) 256) + (logtest? (-> v1-11 root-prim prim-core action) 1024) + ) + ) (set! (-> self control unknown-uint31) (the-as uint 1)) ) ) @@ -3218,11 +3135,9 @@ ) :enter (behavior () - (if (or - (and - (= (-> self fact-info-target eco-type) 1) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (if (or (and (= (-> self fact-info-target eco-type) 1) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (< (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 450) ) (go target-yellow-blast) @@ -3254,40 +3169,37 @@ :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) - (if (and - (or - (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) - ) - (begin - (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) - (set! (-> self control unknown-float81) 0.0) - (let ((gp-0 (new-stack-vector0)) - (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - ) - 0.0 - (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) - (let* ((f0-5 (vector-length gp-0)) - (f1-1 f0-5) - (f2-1 (fmin 0.0 f30-0)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) - (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) - ) - ) - ) - #t - ) - (or - (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) - ) - (!= (-> self control unknown-uint31) 1) - ) + (if (and (or (smack-surface? #t) + (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + ) + (begin + (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) + (set! (-> self control unknown-float81) 0.0) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f0-5 (vector-length gp-0)) + (f1-1 f0-5) + (f2-1 (fmin 0.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) + ) + ) + ) + #t + ) + (or (zero? (-> self control unknown-uint20)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + (!= (-> self control unknown-uint31) 1) + ) (target-shoved (-> *TARGET-bank* smack-surface-dist) (-> *TARGET-bank* smack-surface-height) @@ -3295,33 +3207,28 @@ (the-as (state target) target-hit) ) ) - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) - (and - (< 4096.0 (-> self control unknown-float01)) - (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - (zero? - (logand - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (and (< 4096.0 (-> self control unknown-float01)) + (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (zero? + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + ) + (zero? (logand (-> self state-flags) 6144)) + (zero? (logand (-> self control unknown-surface01 flags) 128)) ) - ) - (zero? (logand (-> self state-flags) 6144)) - (zero? (logand (-> self control unknown-surface01 flags) 128)) - ) - ) + ) (go target-attack-uppercut (-> *TARGET-bank* attack-jump-height-min) (-> *TARGET-bank* attack-jump-height-max) ) ) - (if (and - (logtest? (-> self water flags) 512) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) - ) + (if (and (logtest? (-> self water flags) 512) + (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + ) (dummy-13 (-> self water) (the-as float 0.6) @@ -3330,10 +3237,9 @@ (-> self control transv) ) ) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 30) (level-hint-spawn @@ -3371,55 +3277,47 @@ (TODO-RENAME-9 (-> self align)) (when (not (ja-min? 0)) (cond - ((and - (>= (ja-aframe-num 0) 20.0) - (and - (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) ) - ) - (or - (not - (or - (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-39 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not + (or (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) ) - ) - (< 4096.0 (target-height-above-ground)) ) - ) - ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) - ) - ) + ) (go target-falling #f) ) - ((and - (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) - ) + ((and (nonzero? (-> self control unknown-uint30)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) + (the-as uint 12) + ) + ) (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) ) - ((and - (zero? (logand - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) - ) + ((and (zero? (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) + ) (if (= (-> self control ground-pat material) (pat-material ice)) (set-forward-vel (fmax 32768.0 (* 0.8 (-> self control unknown-float01)))) (set-forward-vel (* 0.8 (-> self control unknown-float01))) @@ -3456,28 +3354,25 @@ (+! gp-2 1) ) ) - (if (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (-> *TARGET-bank* ground-timeout)) - ) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-121 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - ) - ) - (or - (not (or - (= v1-121 (-> self draw art-group data 59)) - (= v1-121 (-> self draw art-group data 60)) - (= v1-121 (-> self draw art-group data 61)) - ) - ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) + (if (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (-> *TARGET-bank* ground-timeout)) + ) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-121 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-121 (-> self draw art-group data 59)) + (= v1-121 (-> self draw art-group data 60)) + (= v1-121 (-> self draw art-group data 61)) + ) + ) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) (go target-falling #f) ) (go target-stance) @@ -3535,10 +3430,10 @@ (f30-0 (* 0.5 f1-5 (-> *display* seconds-per-frame) f0-1)) ) (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 62) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 62) + ) (set! f30-0 (fmax 0.0 @@ -3596,19 +3491,17 @@ ) ) ) - (when (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) - (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control unknown-vector10)) + (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) + ) ) - ) (set! (-> self control dynam gravity-max) (-> self control unknown-dynamics00 gravity-max)) (set! (-> self control dynam gravity-length) (-> self control unknown-dynamics00 gravity-length)) ) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 70) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 30) (level-hint-spawn @@ -3662,10 +3555,9 @@ (f1-1 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) ) (while (not - (or - (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 510) - ) + (or (and (< (fabs (/ f0-8 (* 0.0033333334 f1-1))) 150.0) (< f1-1 0.0)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 510) + ) ) (quaternion-rotate-y! (-> self control unknown-quaternion00) @@ -3747,8 +3639,8 @@ :code (behavior ((arg0 float) (arg1 float)) (let ((s3-0 (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 31) ) ) @@ -3785,10 +3677,9 @@ target-dangerous-event-handler :enter (behavior ((arg0 float) (arg1 float)) - (if (and - (= (-> self control ground-pat material) (pat-material ice)) - (< 32768.0 (-> self control unknown-float01)) - ) + (if (and (= (-> self control ground-pat material) (pat-material ice)) + (< 32768.0 (-> self control unknown-float01)) + ) (set-forward-vel (the-as float 32768.0)) ) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -3806,21 +3697,18 @@ (if (logtest? (-> self control status) 1) (go target-hit-ground #f) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) - ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 22118.4) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + ) + ) (set-quaternion! (-> self control) (-> self control dir-targ)) (build-conversions (-> self control transv)) (go @@ -3834,19 +3722,17 @@ ) ) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - (= (if (> (-> self skel active-channels) 0) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) ) - (-> self draw art-group data 62) - ) - (>= (ja-aframe-num 0) 12.0) - ) + (-> self draw art-group data 62) + ) + (>= (ja-aframe-num 0) 12.0) + ) (go target-attack-air 'uppercut) ) (mod-var-jump @@ -3855,17 +3741,15 @@ (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) (-> self control transv) ) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick (ja-frame-num 0) 23) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 30) ) - (if (and - (= (-> self control unknown-symbol30) 'uppercut) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) - ) + (if (and (= (-> self control unknown-symbol30) 'uppercut) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) -8192.0) + ) (target-danger-set! 'harmless #f) ) (slide-down-test) @@ -3953,10 +3837,9 @@ ) :enter (behavior ((arg0 float) (arg1 float) (arg2 float)) - (if (and - (= (-> self fact-info-target eco-type) 1) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (if (and (= (-> self fact-info-target eco-type) 1) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (go target-yellow-jump-blast) ) (if (= arg2 0.0) @@ -4007,24 +3890,21 @@ (or (= v1-6 (-> self draw art-group data 64)) (= v1-6 (-> self draw art-group data 66))) ) ) - (when (and - (or - (< (target-move-dist 30) 1638.4) - (and (logtest? (-> self control status) 8) (< 0.7 (-> self control poly-angle))) - ) - (zero? (logand (-> self control status) 32)) - (>= (-> self control unknown-uint20) (the-as uint 2)) - ) + (when (and (or (< (target-move-dist 30) 1638.4) + (and (logtest? (-> self control status) 8) (< 0.7 (-> self control poly-angle))) + ) + (zero? (logand (-> self control status) 32)) + (>= (-> self control unknown-uint20) (the-as uint 2)) + ) (set! (-> self control unknown-dword36) (-> *display* base-frame-counter)) (set! gp-1 'stuck) ) ) (when gp-1 (logior! (-> self control status) 1) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 255 150) (dummy-10 (-> self skel effect) 'group-red-eco-strike-ground (ja-frame-num 0) 0) (let* ((s4-1 (get-process *default-dead-pool* touch-tracker #x4000)) @@ -4058,10 +3938,9 @@ (go target-flop-hit-ground gp-1) ) ) - (when (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) + (when (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick @@ -4073,15 +3952,14 @@ ) (cpad-set-buzz! (-> *cpad-list* cpads 0) 1 153 30) ) - (when (and - (not (-> self control unknown-symbol30)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 63) + (when (and (not (-> self control unknown-symbol30)) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 63) + ) + (>= (ja-aframe-num 0) 8.0) ) - (>= (ja-aframe-num 0) 8.0) - ) (target-start-attack) (target-danger-set! 'flop #f) ) @@ -4227,11 +4105,10 @@ (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> *TARGET-bank* fall-timeout))) (go target-falling #f) ) - (if (and - (= *cheat-mode* 'debug) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - (not *pause-lock*) - ) + (if (and (= *cheat-mode* 'debug) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (not *pause-lock*) + ) (go target-falling #f) ) (suspend) @@ -4283,23 +4160,19 @@ :trans (behavior () (when (!= (-> self control unknown-spoolanim00) 'stuck) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack-air 'flop) ) ) - (when (and - (and - (= (-> self fact-info-target eco-type) 2) - (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) - ) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 75) - ) + (when (and (and (= (-> self fact-info-target eco-type) 2) + (>= (-> self fact-info-target eco-level) (-> (new 'static 'array float 1 1.0) 0)) + ) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 75) + ) (dummy-10 (-> self skel effect) 'group-red-eco-spinkick @@ -4316,10 +4189,9 @@ ) ) ) - (if (and - (or (= v1-33 (-> self draw art-group data 65)) (= v1-33 (-> self draw art-group data 68))) - (>= (ja-aframe-num 0) 28.0) - ) + (if (and (or (= v1-33 (-> self draw art-group data 65)) (= v1-33 (-> self draw art-group data 68))) + (>= (ja-aframe-num 0) 28.0) + ) (logior! (-> *flop-land-mods* flags) 1024) ) ) @@ -4327,7 +4199,11 @@ (none) ) :code - (behavior ((arg0 symbol)) (target-hit-ground-anim arg0) (go target-falling #f) (none)) + (behavior ((arg0 symbol)) + (target-hit-ground-anim arg0) + (go target-falling #f) + (none) + ) :post (the-as (function none :behavior target) target-post) ) @@ -4388,13 +4264,12 @@ (if (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) (set! gp-0 (-> *display* base-frame-counter)) ) - (when (and - (or (smack-surface? #f) (>= (-> self control unknown-float63) 0.7)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 3) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1) - ) + (when (and (or (smack-surface? #f) (>= (-> self control unknown-float63) 0.7)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 3) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1) + ) (if (>= 6.0 (ja-aframe-num 0)) (target-shoved (-> *TARGET-bank* smack-surface-dist) @@ -4407,10 +4282,9 @@ (set! s5-0 (-> *display* base-frame-counter)) ) ) - (if (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) + (if (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) (-> *display* base-frame-counter) ) (TODO-RENAME-9 (-> self align)) @@ -4441,13 +4315,11 @@ (set! f30-0 (* f30-0 (fmin (-> (new 'static 'array float 1 1.0) 0) (-> self control unknown-float140)))) ) ) - (if (and - (or - (< (- (-> *display* base-frame-counter) gp-0) (the-as int (-> *TARGET-bank* wheel-jump-pre-window))) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) - ) - (can-jump? 'target-wheel-flip) - ) + (if (and (or (< (- (-> *display* base-frame-counter) gp-0) (the-as int (-> *TARGET-bank* wheel-jump-pre-window))) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + ) + (can-jump? 'target-wheel-flip) + ) (go target-wheel-flip (-> *TARGET-bank* wheel-flip-height) (-> *TARGET-bank* wheel-flip-dist)) ) ) @@ -4462,19 +4334,15 @@ (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? 'target-wheel-flip) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? 'target-wheel-flip) + ) (go target-wheel-flip (-> *TARGET-bank* wheel-flip-height) (-> *TARGET-bank* wheel-flip-dist)) ) ) @@ -4494,18 +4362,19 @@ :event target-standard-event-handler :enter - (behavior ((arg0 float) (arg1 float)) (set! (-> self control unknown-surface00) *wheel-flip-mods*) (none)) + (behavior ((arg0 float) (arg1 float)) + (set! (-> self control unknown-surface00) *wheel-flip-mods*) + (none) + ) :exit target-exit :trans (behavior () - (if (and - (or - (smack-surface? #f) - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - ) - (!= (-> self state-time) (-> *display* base-frame-counter)) - ) + (if (and (or (smack-surface? #f) + (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + ) + (!= (-> self state-time) (-> *display* base-frame-counter)) + ) (target-shoved (-> *TARGET-bank* smack-surface-dist) (-> *TARGET-bank* smack-surface-height) @@ -4513,21 +4382,18 @@ (the-as (state target) target-hit) ) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle) - ) - (can-feet?) - (and - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) - (= (-> self skel root-channel 0) (-> self skel channel)) - ) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle) + ) + (can-feet?) + (and (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 38) + ) + (= (-> self skel root-channel 0) (-> self skel channel)) + ) + ) (go target-attack-air #f) ) (none) @@ -4585,8 +4451,8 @@ (while (zero? (logand (-> self control status) 1)) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 3) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 38) ) ) @@ -4620,8 +4486,8 @@ (suspend) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 38) ) (let ((a0-35 (-> self skel root-channel 0))) @@ -4647,19 +4513,15 @@ (set! (-> self state-hook) (the-as (function none :behavior target) nothing)) ) (else - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-high-jump (-> *TARGET-bank* flip-jump-height-min) (-> *TARGET-bank* flip-jump-height-max) 'flip) ) ) @@ -4668,10 +4530,10 @@ ) ) (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 38) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 38) + ) (go target-hit-ground #f) (go target-stance) ) diff --git a/test/decompiler/reference/engine/ui/hud-classes_REF.gc b/test/decompiler/reference/engine/ui/hud-classes_REF.gc index 6eeb8bfd7f..8a09073373 100644 --- a/test/decompiler/reference/engine/ui/hud-classes_REF.gc +++ b/test/decompiler/reference/engine/ui/hud-classes_REF.gc @@ -186,8 +186,8 @@ s5-0 (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) + (the int (-> *video-parms* relative-y-scale)) + ) 2 ) (font-color bright-green) @@ -611,10 +611,10 @@ *font-default-matrix* (+ (* (-> obj x-sgn) (-> obj offset)) -60 (-> obj text-x)) (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) - 2 - ) + (the int (-> *video-parms* relative-y-scale)) + ) + 2 + ) -17 ) 0.0 @@ -654,10 +654,10 @@ s3-0 (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset)) s1-0) (+ (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) - 2 - ) + (the int (-> *video-parms* relative-y-scale)) + ) + 2 + ) s5-0 ) (font-color dark-yellow) @@ -909,8 +909,8 @@ s5-0 (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) + (the int (-> *video-parms* relative-y-scale)) + ) 2 ) (font-color dark-yellow) @@ -1390,8 +1390,8 @@ s5-0 (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) + (the int (-> *video-parms* relative-y-scale)) + ) 2 ) (font-color dark-yellow) @@ -1699,9 +1699,9 @@ (t9-0 obj) ) (set! (-> obj text-y) (+ (if (nonzero? (-> obj next-y-offset)) - (-> obj text-y-offset) - 0 - ) + (-> obj text-y-offset) + 0 + ) 362 ) ) @@ -1715,8 +1715,8 @@ s5-0 (+ (-> obj text-x) (* (-> obj x-sgn) (-> obj offset))) (/ (* (+ (-> obj text-y) (* (-> obj y-sgn) (-> obj offset)) (-> obj y-offset)) - (the int (-> *video-parms* relative-y-scale)) - ) + (the int (-> *video-parms* relative-y-scale)) + ) 2 ) (font-color dark-yellow) @@ -1790,9 +1790,9 @@ ;; definition for method 22 of type hud-buzzers (defmethod first-icon-y hud-buzzers ((obj hud-buzzers)) (+ (if (= (-> *setting-control* current video-mode) 'pal) - (+ (-> obj text-y) 120) - (+ (-> obj text-y) 50) - ) + (+ (-> obj text-y) 120) + (+ (-> obj text-y) 50) + ) (-> obj next-y-offset) ) ) @@ -2041,16 +2041,16 @@ (defun part-hud-eco-timer-01-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as - uint - (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) - ) - ) - ) - ) + (the-as + uint + (- (-> *target* fact-info-target eco-timeout) + (the-as + uint + (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) + ) + ) + ) + ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) ) @@ -2090,16 +2090,16 @@ (defun part-hud-eco-timer-02-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as - uint - (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) - ) - ) - ) - ) + (the-as + uint + (- (-> *target* fact-info-target eco-timeout) + (the-as + uint + (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) + ) + ) + ) + ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) ) @@ -2139,16 +2139,16 @@ (defun part-hud-eco-timer-03-func ((arg0 basic) (arg1 basic) (arg2 hud-particle)) (let ((f0-2 (/ (the float - (the-as - uint - (- (-> *target* fact-info-target eco-timeout) - (the-as - uint - (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) - ) - ) - ) - ) + (the-as + uint + (- (-> *target* fact-info-target eco-timeout) + (the-as + uint + (- (-> *display* game-frame-counter) (the-as int (-> *target* fact-info-target eco-pickup-time))) + ) + ) + ) + ) (the float (the-as uint (-> *FACT-bank* eco-full-timeout))) ) ) @@ -2424,8 +2424,7 @@ (when *target* (dotimes (s5-0 9) (when (-> *hud-parts* parts s5-0) - (if (or - (!= (-> *hud-parts* parts s5-0) arg0) + (if (or (!= (-> *hud-parts* parts s5-0) arg0) (zero? (-> (the-as (pointer hud) (-> *hud-parts* parts s5-0)) 0 value)) ) (send-event (ppointer->process (-> *hud-parts* parts s5-0)) 'hide) diff --git a/test/decompiler/reference/engine/ui/hud_REF.gc b/test/decompiler/reference/engine/ui/hud_REF.gc index 5f9aabad41..3b0a025616 100644 --- a/test/decompiler/reference/engine/ui/hud_REF.gc +++ b/test/decompiler/reference/engine/ui/hud_REF.gc @@ -49,46 +49,41 @@ (if (= arg0 (-> obj target-value)) (set! (-> obj last-target-equal-time) (the-as uint (-> *display* base-frame-counter))) ) - (when (and (not *progress-process*) (and - (!= (-> obj last-hide-time) (-> *display* base-frame-counter)) - (not (movie?)) - (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) 30) - (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) 30) - (not (and *target* (logtest? (-> *target* state-flags) 256))) - ) + (when (and (not *progress-process*) + (and (!= (-> obj last-hide-time) (-> *display* base-frame-counter)) + (not (movie?)) + (>= (- (-> *display* base-frame-counter) (-> *game-info* letterbox-time)) 30) + (>= (- (-> *display* base-frame-counter) (-> *game-info* blackout-time)) 30) + (not (and *target* (logtest? (-> *target* state-flags) 256))) + ) ) - (when (or - (!= (-> obj value) arg0) - (!= (-> obj value2) arg1) - (-> obj force-on-screen) - (or - (and (cpad-hold? 0 l2) (not (-> obj disable))) - (and (not *cheat-mode*) (cpad-hold? 0 r2)) - (-> obj first-init) + (when (or (!= (-> obj value) arg0) + (!= (-> obj value2) arg1) + (-> obj force-on-screen) + (or (and (cpad-hold? 0 l2) (not (-> obj disable))) + (and (not *cheat-mode*) (cpad-hold? 0 r2)) + (-> obj first-init) + ) ) - ) (cond - ((and - (-> obj increment-on-event) - (< (-> obj value) arg0) - (not (-> obj first-init)) - (< (- (-> *display* base-frame-counter) (the-as int (-> obj last-target-equal-time))) 450) - ) - (when (and - (!= (-> obj value) (-> obj target-value)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj last-increment-time))) 30) - ) + ((and (-> obj increment-on-event) + (< (-> obj value) arg0) + (not (-> obj first-init)) + (< (- (-> *display* base-frame-counter) (the-as int (-> obj last-target-equal-time))) 450) + ) + (when (and (!= (-> obj value) (-> obj target-value)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> obj last-increment-time))) 30) + ) (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) (+! (-> obj value) 1) (set! (-> obj last-increment-time) (the-as uint (-> *display* base-frame-counter))) ) ) (else - (if (not (and - (not (-> obj first-init)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj last-target-equal-time))) 450) - ) - ) + (if (not (and (not (-> obj first-init)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> obj last-target-equal-time))) 450) + ) + ) (set! (-> obj value) arg0) ) (set! (-> obj target-value) arg0) @@ -126,13 +121,13 @@ ) (set! (-> obj icons v1-0 icon 0 root trans y) (- (+ (the float (-> obj icons v1-0 icon-y)) - (* (the float (-> obj y-sgn)) - (the float (-> obj offset)) - (-> *video-parms* relative-y-scale) - (-> *video-parms* relative-y-scale) - ) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) - ) + (* (the float (-> obj y-sgn)) + (the float (-> obj offset)) + (-> *video-parms* relative-y-scale) + (-> *video-parms* relative-y-scale) + ) + (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + ) (the float (-> *video-parms* screen-sy)) ) ) @@ -151,11 +146,11 @@ ) (set! (-> obj particles s5-0 pos y) (* 0.5 (- (* (-> *video-parms* relative-y-scale) - (+ (-> obj particles s5-0 init-pos y) - (the float (* (-> obj y-sgn) (-> obj offset))) - (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) - ) - ) + (+ (-> obj particles s5-0 init-pos y) + (the float (* (-> obj y-sgn) (-> obj offset))) + (* (the float (-> obj y-offset)) (-> *video-parms* relative-x-scale-reciprical)) + ) + ) (the float (-> *video-parms* screen-sy)) ) ) @@ -284,7 +279,10 @@ (none) ) :exit - (behavior () (set! (-> self y-offset) (-> self next-y-offset)) (none)) + (behavior () + (set! (-> self y-offset) (-> self next-y-offset)) + (none) + ) :code (behavior () (logior! (-> self mask) (process-mask sleep-code)) @@ -388,7 +386,12 @@ (none) ) :post - (behavior () (TODO-RENAME-19 self) (dummy-18 self) (dummy-15 self) (none)) + (behavior () + (TODO-RENAME-19 self) + (dummy-18 self) + (dummy-15 self) + (none) + ) ) ;; failed to figure out what this is: @@ -551,7 +554,3 @@ :post (the-as (function none :behavior collectable) ja-post) ) - - - - diff --git a/test/decompiler/reference/engine/ui/progress-h_REF.gc b/test/decompiler/reference/engine/ui/progress-h_REF.gc index 39766ba3ae..955c49229d 100644 --- a/test/decompiler/reference/engine/ui/progress-h_REF.gc +++ b/test/decompiler/reference/engine/ui/progress-h_REF.gc @@ -156,7 +156,7 @@ (total-nb-of-buzzers int32 :offset-assert 288) (card-info mc-slot-info :offset-assert 292) (last-option-index-change int64 :offset-assert 296) - (video-mode-timeout uint64 :offset-assert 304) + (video-mode-timeout int64 :offset-assert 304) (display-state-stack progress-screen 5 :offset-assert 312) (option-index-stack int32 5 :offset-assert 352) (display-state-pos int32 :offset-assert 372) diff --git a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc index 2322298d4f..3a143884b7 100644 --- a/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc +++ b/test/decompiler/reference/engine/ui/progress/progress-draw_REF.gc @@ -124,12 +124,11 @@ (+! s0-0 1) ) (when *common-text* - (when (and - (!= s1-0 -1) - (> (-> s5-0 nb-of-tasks) 0) - (>= (-> obj task-index) 0) - (< (-> obj task-index) (-> s5-0 nb-of-tasks)) - ) + (when (and (!= s1-0 -1) + (> (-> s5-0 nb-of-tasks) 0) + (>= (-> obj task-index) 0) + (< (-> obj task-index) (-> s5-0 nb-of-tasks)) + ) (let ((s0-1 (new 'stack 'font-context @@ -726,10 +725,9 @@ (let ((v1-57 arg0)) (set! (-> v1-57 scale) 0.6) ) - (if (and - (< (-> s3-3 file s1-0 level-index) (length *level-task-data-remap*)) - (> (-> s3-3 file s1-0 level-index) 0) - ) + (if (and (< (-> s3-3 file s1-0 level-index) (length *level-task-data-remap*)) + (> (-> s3-3 file s1-0 level-index) 0) + ) (print-game-text (lookup-text! *common-text* @@ -747,14 +745,12 @@ (set! (-> a0-28 color) (font-color blue-white)) ) (cond - ((or - (>= 600 (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) - (or - (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) - (!= (-> obj option-index) s1-0) - (-> obj in-transition) + ((or (>= 600 (- (-> *display* real-frame-counter) (-> obj last-option-index-change))) + (or (< (mod (- (-> *display* real-frame-counter) (-> obj last-option-index-change)) 1200) 600) + (!= (-> obj option-index) s1-0) + (-> obj in-transition) + ) ) - ) (let ((v1-87 arg0)) (set! (-> v1-87 scale) 0.5) ) @@ -1180,9 +1176,9 @@ (set! (-> *progress-process* 0 particles 31 init-pos x) (the float (- (if (or (< (mod (-> *display* real-frame-counter) 300) 270) (!= (-> obj transition-percentage-invert) 1.0)) - 205 - -320 - ) + 205 + -320 + ) (-> obj left-x-offset) ) ) @@ -1756,10 +1752,9 @@ ((= v1-81 1) (set! sv-512 (-> obj language-selection)) (set! sv-448 (-> (the-as (pointer uint64) (-> s3-0 s0-0 value-to-modify)))) - (if (and - (zero? (scf-get-territory)) - (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) - ) + (if (and (zero? (scf-get-territory)) + (not (and (= *progress-cheat* 'language) (cpad-hold? 0 l2) (cpad-hold? 0 r2))) + ) (set! sv-464 5) (set! sv-464 6) ) @@ -2096,11 +2091,11 @@ ) (set! (-> s4-2 origin x) (+ (- 435.0 (the float (if (< (-> *progress-process* 0 completion-percentage) 10.0) - 93 - 80 - ) - ) - ) + 93 + 80 + ) + ) + ) f30-0 ) ) diff --git a/test/decompiler/reference/engine/ui/text_REF.gc b/test/decompiler/reference/engine/ui/text_REF.gc index 7d791661ac..38ac23fe44 100644 --- a/test/decompiler/reference/engine/ui/text_REF.gc +++ b/test/decompiler/reference/engine/ui/text_REF.gc @@ -113,11 +113,10 @@ (if (and (= (scf-get-territory) 1) (zero? lang)) (set! lang 6) ) - (when (or - (= heap-sym-heap #f) - (!= (-> heap-sym-heap language-id) lang) - (not (string= (-> heap-sym-heap group-name) txt-name)) - ) + (when (or (= heap-sym-heap #f) + (!= (-> heap-sym-heap language-id) lang) + (not (string= (-> heap-sym-heap group-name) txt-name)) + ) (let ((v1-16 heap)) (set! (-> v1-16 current) (-> v1-16 base)) ) @@ -409,10 +408,9 @@ ) (set! (-> gp-0 width) (-> font-ctxt width)) (set! (-> gp-0 height) (-> font-ctxt height)) - (+! - (-> gp-0 origin y) - (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))))) - ) + (+! (-> gp-0 origin y) + (the float (the int (* 0.5 (- (-> gp-0 height) (print-game-text str gp-0 #t 128 22))))) + ) (set! (-> gp-0 width) f30-0) (set! (-> gp-0 height) f28-0) ) @@ -430,9 +428,9 @@ (set! sv-156 (+ (-> gp-0 origin y) (-> font-ctxt height))) (set! sv-160 (* (get-string-length " " gp-0) (-> *video-parms* relative-x-scale))) (set! sv-164 (* (if (logtest? (-> gp-0 flags) (font-flags large)) - (the float arg4) - 14.0 - ) + (the float arg4) + 14.0 + ) sv-136 ) ) diff --git a/test/decompiler/reference/engine/util/sync-info_REF.gc b/test/decompiler/reference/engine/util/sync-info_REF.gc index 8f27d1b833..99cd180d4a 100644 --- a/test/decompiler/reference/engine/util/sync-info_REF.gc +++ b/test/decompiler/reference/engine/util/sync-info_REF.gc @@ -318,18 +318,18 @@ ) (let* ((tlo (-> obj tlo)) (eased-phase (/ (cond - ((< current-val tlo) - (* current-val current-val) - ) - ((< current-val (-> obj thi)) - (+ (* 2.0 tlo (- current-val tlo)) (-> obj ylo)) - ) - (else - (let ((f1-7 (- 1.0 current-val))) - (- (-> obj yend) (* f1-7 f1-7 (-> obj m2))) - ) - ) + ((< current-val tlo) + (* current-val current-val) ) + ((< current-val (-> obj thi)) + (+ (* 2.0 tlo (- current-val tlo)) (-> obj ylo)) + ) + (else + (let ((f1-7 (- 1.0 current-val))) + (- (-> obj yend) (* f1-7 f1-7 (-> obj m2))) + ) + ) + ) (-> obj yend) ) ) diff --git a/test/decompiler/reference/kernel/gkernel_REF.gc b/test/decompiler/reference/kernel/gkernel_REF.gc index 4c229f906e..638c190dd1 100644 --- a/test/decompiler/reference/kernel/gkernel_REF.gc +++ b/test/decompiler/reference/kernel/gkernel_REF.gc @@ -699,9 +699,9 @@ (set! (-> obj child) (the-as (pointer process-tree) #f)) (let ((s5-1 (-> arg0 ppointer))) (if (or (= (-> obj first-gap) s5-1) (< (the-as int (gap-location obj (the-as dead-pool-heap-rec s5-1))) - (the-as int (gap-location obj (-> obj first-gap))) - ) - ) + (the-as int (gap-location obj (-> obj first-gap))) + ) + ) (set! (-> obj first-gap) (the-as dead-pool-heap-rec (-> s5-1 1))) ) (when (= (-> obj first-shrink) s5-1) @@ -727,10 +727,9 @@ (defmethod shrink-heap dead-pool-heap ((obj dead-pool-heap) (arg0 process)) (when arg0 (let ((s5-0 (-> arg0 ppointer))) - (when (not (or - (logtest? (-> arg0 mask) (process-mask heap-shrunk)) - (and (not (-> arg0 next-state)) (not (-> arg0 state))) - ) + (when (not (or (logtest? (-> arg0 mask) (process-mask heap-shrunk)) + (and (not (-> arg0 next-state)) (not (-> arg0 state))) + ) ) (set! (-> arg0 allocated-length) (&- (-> arg0 heap-cur) (the-as uint (-> arg0 stack)))) (set! (-> arg0 heap-top) (&-> arg0 stack (-> arg0 allocated-length))) @@ -812,8 +811,7 @@ (+! arg0 -1) (let ((s4-0 (-> obj alive-list next))) (when s4-0 - (if (or - (= (-> obj first-gap) s4-0) + (if (or (= (-> obj first-gap) s4-0) (< (the-as int (gap-location obj s4-0)) (the-as int (gap-location obj (-> obj first-gap)))) ) (set! (-> obj first-gap) (-> s4-0 prev)) @@ -959,11 +957,10 @@ ;; definition for function execute-process-tree (defun execute-process-tree ((arg0 process-tree) (arg1 (function object object)) (arg2 kernel-context)) - (let ((s3-0 (or - (logtest? (-> arg0 mask) (process-mask process-tree)) - (not (and (zero? (logand (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) - (arg1 arg0) - ) + (let ((s3-0 (or (logtest? (-> arg0 mask) (process-mask process-tree)) + (not (and (zero? (logand (-> arg2 prevent-from-run) (-> arg0 mask))) (run-logic? arg0))) + (arg1 arg0) + ) ) ) (cond diff --git a/test/decompiler/reference/kernel/gstring_REF.gc b/test/decompiler/reference/kernel/gstring_REF.gc index 75b201b664..fcad694113 100644 --- a/test/decompiler/reference/kernel/gstring_REF.gc +++ b/test/decompiler/reference/kernel/gstring_REF.gc @@ -384,10 +384,9 @@ (defun string-strip-trailing-whitespace! ((str string)) (when (nonzero? (length str)) (let ((ptr (&+ (-> str data) (+ (length str) -1)))) - (while (and - (>= (the-as int ptr) (the-as int (-> str data))) - (or (= (-> ptr 0) 32) (= (-> ptr 0) 9) (= (-> ptr 0) 13) (= (-> ptr 0) 10)) - ) + (while (and (>= (the-as int ptr) (the-as int (-> str data))) + (or (= (-> ptr 0) 32) (= (-> ptr 0) 9) (= (-> ptr 0) 13) (= (-> ptr 0) 10)) + ) (set! ptr (&-> ptr -1)) ) (set! (-> ptr 1) (the-as uint 0)) @@ -427,13 +426,12 @@ ) ((nonzero? (-> arg-word-start 0)) (let ((v1-11 arg-word-start)) - (while (and - (nonzero? (-> arg-word-start 0)) - (!= (-> arg-word-start 0) 32) - (!= (-> arg-word-start 0) 9) - (!= (-> arg-word-start 0) 13) - (!= (-> arg-word-start 0) 10) - ) + (while (and (nonzero? (-> arg-word-start 0)) + (!= (-> arg-word-start 0) 32) + (!= (-> arg-word-start 0) 9) + (!= (-> arg-word-start 0) 13) + (!= (-> arg-word-start 0) 10) + ) (set! arg-word-start (&-> arg-word-start 1)) ) (copyn-string<-charp a-str v1-11 (&- arg-word-start (the-as uint v1-11))) @@ -464,11 +462,10 @@ (set! negate #t) (set! next-char-2 (&-> next-char-2 1)) ) - (while (or - (and (>= (-> next-char-2 0) (the-as uint 48)) (>= (the-as uint 57) (-> next-char-2 0))) - (and (>= (-> next-char-2 0) (the-as uint 65)) (>= (the-as uint 70) (-> next-char-2 0))) - (and (>= (-> next-char-2 0) (the-as uint 97)) (>= (the-as uint 102) (-> next-char-2 0))) - ) + (while (or (and (>= (-> next-char-2 0) (the-as uint 48)) (>= (the-as uint 57) (-> next-char-2 0))) + (and (>= (-> next-char-2 0) (the-as uint 65)) (>= (the-as uint 70) (-> next-char-2 0))) + (and (>= (-> next-char-2 0) (the-as uint 97)) (>= (the-as uint 102) (-> next-char-2 0))) + ) (cond ((and (>= (-> next-char-2 0) (the-as uint 65)) (>= (the-as uint 70) (-> next-char-2 0))) (set! result (the-as int (+ (-> next-char-2 0) -55 (* result 16)))) diff --git a/test/decompiler/reference/levels/beach/beach-obs_REF.gc b/test/decompiler/reference/levels/beach/beach-obs_REF.gc index ed3b60661c..24dbced0ef 100644 --- a/test/decompiler/reference/levels/beach/beach-obs_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-obs_REF.gc @@ -45,7 +45,10 @@ ;; failed to figure out what this is: (defstate windmill-one-idle (windmill-one) :exit - (behavior () (sound-stop (-> self sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (none) + ) :trans (behavior () (rider-trans) @@ -286,15 +289,14 @@ (set! (-> self incomming-attack-id) v1-2) (case (-> arg3 param 1) (('uppercut) - (when (and - (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) - (< (-> self position) (-> self max-position)) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) - ) - ) + (when (and (< (-> *target* control trans y) (+ -40960.0 (-> self root-override trans y))) + (< (-> self position) (-> self max-position)) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) + ) + ) (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) (increment-success-for-hint (game-text-id beach-grottopole-increment)) @@ -302,15 +304,14 @@ ) ) (('flop) - (when (and - (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) - (> (-> self position) 0) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 1) - ) - ) + (when (and (< (+ -40960.0 (-> self root-override trans y)) (-> *target* control trans y)) + (> (-> self position) 0) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 1) + ) + ) (sound-play-by-name (static-sound-name "grotto-pole-hit") (new-sound-id) 1024 0 0 1 #t) (sound-play-by-name (static-sound-name "dirt-crumble") (new-sound-id) 1024 0 0 1 #t) (go grottopole-moving-down) @@ -710,7 +711,10 @@ process-drawable-fuel-cell-handler ) :enter - (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior ((arg0 symbol)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior ((arg0 symbol)) (local-vars (sv-128 symbol)) @@ -908,7 +912,10 @@ ;; failed to figure out what this is: (defstate flying-rock-rolling (flying-rock) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (let ((gp-0 #f) @@ -985,13 +992,11 @@ :code (behavior () (clear-collide-with-as (-> self root-override)) - (while (or - (logtest? (-> self draw status) (draw-status drwf03)) - (and - *target* - (>= 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + (while (or (logtest? (-> self draw status) (draw-status drwf03)) + (and *target* + (>= 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) ) - ) (suspend) ) (deactivate self) @@ -1267,11 +1272,10 @@ (defstate flutflutegg-idle (flutflutegg) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (and - (= arg2 'attack) - (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> arg3 param 2)) - ) + (when (and (= arg2 'attack) + (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> arg3 param 2)) + ) (set! (-> self incomming-attack-id) (-> arg3 param 2)) (flutflutegg-hit-sounds) (let ((s5-1 @@ -1367,12 +1371,11 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object - (when (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) - (= arg2 'attack) - (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) - (!= (-> self incomming-attack-id) (-> arg3 param 2)) - ) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (= arg2 'attack) + (or (= (-> arg3 param 1) 'punch) (= (-> arg3 param 1) 'spin) (= (-> arg3 param 1) 'spin-air)) + (!= (-> self incomming-attack-id) (-> arg3 param 2)) + ) (set! (-> self incomming-attack-id) (-> arg3 param 2)) (flutflutegg-hit-sounds) (let ((s5-1 @@ -1475,10 +1478,9 @@ (quaternion*! (-> self root-override quat) (-> self root-override quat) a2-6) ) (suspend) - (set! v1-25 (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) - (logtest? (-> self root-override status) 1) - ) + (set! v1-25 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (logtest? (-> self root-override status) 1) + ) ) ) (sound-play-by-name (static-sound-name "sack-land") (new-sound-id) 2048 0 0 1 #t) @@ -1529,10 +1531,9 @@ (the float (+ (-> (the-as art-joint-anim (-> self draw art-group data 5)) data 0 length) -1)) ) ) - (while (and - (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) - (zero? (logand (-> self ambients-played) 1024)) - ) + (while (and (not (task-closed? (game-task beach-flutflut) (task-status need-reward-speech))) + (zero? (logand (-> self ambients-played) 1024)) + ) (if (play-ambient (-> self ambient) "BIR-AM11" #f (the-as vector #f)) (logior! (-> self ambients-played) 1024) ) diff --git a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc index 43d423e7c8..f5eff8acf7 100644 --- a/test/decompiler/reference/levels/beach/beach-rocks_REF.gc +++ b/test/decompiler/reference/levels/beach/beach-rocks_REF.gc @@ -340,16 +340,17 @@ (defstate idle (beach-rock) :virtual #t :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (set! (-> self trigger) #t) - (go-virtual falling) - ) - (('loading) - (go-virtual loading) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (set! (-> self trigger) #t) + (go-virtual falling) + ) + (('loading) + (go-virtual loading) + ) + ) + ) :code (behavior () (if (-> self trigger) diff --git a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc index 9644d6221f..e02e81a227 100644 --- a/test/decompiler/reference/levels/beach/lurkercrab_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkercrab_REF.gc @@ -101,11 +101,11 @@ ;; INFO: Return type mismatch symbol vs object. (defmethod dummy-44 lurkercrab ((obj lurkercrab) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) (dummy-55 (-> obj collide-info) arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 0.7 6144.0 16384.0) @@ -219,7 +219,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (set! (-> self draw force-lod) -1) (none)) + (behavior () + (set! (-> self draw force-lod) -1) + (none) + ) :code (behavior () (set! (-> self target-speed) 0.0) @@ -327,8 +330,8 @@ nav-enemy-default-event-handler :code (behavior () (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 4) ) (let ((a0-4 (-> self skel root-channel 0))) @@ -477,7 +480,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) ) ;; failed to figure out what this is: @@ -653,7 +659,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) ) ;; failed to figure out what this is: @@ -665,7 +674,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) ) ;; failed to figure out what this is: @@ -705,7 +717,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (set! (-> self orient) #t) (none)) + (behavior () + (set! (-> self orient) #t) + (none) + ) :code (behavior () (set! (-> self momentum-speed) 57344.0) diff --git a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc index d81f17473f..834f7318a6 100644 --- a/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerpuppy_REF.gc @@ -81,8 +81,8 @@ nav-enemy-default-event-handler (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 10) ) (ja-channel-push! 1 51) @@ -293,7 +293,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 16) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 16) + (none) + ) :code (behavior () (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) diff --git a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc index 71e1ac5efd..3e918dd60f 100644 --- a/test/decompiler/reference/levels/beach/lurkerworm_REF.gc +++ b/test/decompiler/reference/levels/beach/lurkerworm_REF.gc @@ -362,10 +362,10 @@ ) (('touch) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) - (the-as uint 1) - ) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root-override) + (the-as uint 1) + ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) ) @@ -392,15 +392,18 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter - (behavior () (ja-channel-set! 0) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (ja-channel-set! 0) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (while #t - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) - *target* - (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) + *target* + (>= 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (go lurkerworm-spot) ) (suspend) @@ -446,7 +449,10 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (ja-channel-set! 1) @@ -488,7 +494,10 @@ lurkerworm-default-post-behavior (none) ) :exit - (behavior () (set! (-> self vulnerable) #f) (none)) + (behavior () + (set! (-> self vulnerable) #f) + (none) + ) :code (behavior () (let* ((f30-0 10.0) @@ -604,7 +613,10 @@ lurkerworm-default-post-behavior :event lurkerworm-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (let ((a0-0 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/beach/pelican_REF.gc b/test/decompiler/reference/levels/beach/pelican_REF.gc index 5ab34c8267..db9fc8427f 100644 --- a/test/decompiler/reference/levels/beach/pelican_REF.gc +++ b/test/decompiler/reference/levels/beach/pelican_REF.gc @@ -180,8 +180,8 @@ (while #t (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) (let ((a0-5 (-> self skel root-channel 0))) @@ -356,10 +356,9 @@ ) (set! (-> self path-pos) (- f0-3 (* (the float (the int (/ f0-3 f1-2))) f1-2))) ) - (when (and - (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self path-vector) (-> *target* control trans)))) - (not (handle->process (-> self cam-tracker))) - ) + (when (and (and *target* (>= 81920.0 (vector-vector-xz-distance (-> self path-vector) (-> *target* control trans)))) + (not (handle->process (-> self cam-tracker))) + ) (let ((gp-1 (get-process *default-dead-pool* camera-tracker #x4000))) (set! (-> self cam-tracker) (ppointer->handle (when gp-1 @@ -486,7 +485,10 @@ (none) ) :exit - (behavior () (set! (-> self draw force-lod) -1) (none)) + (behavior () + (set! (-> self draw force-lod) -1) + (none) + ) :trans (behavior () (if (not (handle->process (-> self fuel-cell))) @@ -633,10 +635,10 @@ (s4-0 (-> (the-as process-drawable v1-13) root trans)) ) (if (< f30-0 - (fabs - (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) - ) + (fabs + (deg-diff (y-angle gp-1) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s4-0 (-> gp-1 trans)))) ) + ) (go pelican-spit) ) ) @@ -885,11 +887,10 @@ ) (run-next-time-in-process gp-2 (lambda :behavior pelican () - (while (or - (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) (suspend) ) (level-hint-spawn @@ -953,11 +954,11 @@ :post (behavior () (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 10) + ) + ) (quaternion-identity! (-> self root-override quat)) ) (pelican-post) @@ -968,7 +969,10 @@ ;; failed to figure out what this is: (defstate pelican-from-nest (pelican) :enter - (behavior () (set! (-> self path-pos) 1.5) (none)) + (behavior () + (set! (-> self path-pos) 1.5) + (none) + ) :trans (behavior () (pelican-path-update 131072.0 150 0.0 0.0 #f) @@ -1055,7 +1059,10 @@ ;; failed to figure out what this is: (defstate pelican-wait-at-end (pelican) :code - (behavior ((arg0 symbol)) (dummy-18 self) (none)) + (behavior ((arg0 symbol)) + (dummy-18 self) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/beach/sculptor_REF.gc b/test/decompiler/reference/levels/beach/sculptor_REF.gc index 5840f0420a..218df6b0dd 100644 --- a/test/decompiler/reference/levels/beach/sculptor_REF.gc +++ b/test/decompiler/reference/levels/beach/sculptor_REF.gc @@ -110,7 +110,10 @@ (defstate give-cell (sculptor) :virtual #t :enter - (behavior () (muse-to-idle (the-as muse self)) (none)) + (behavior () + (muse-to-idle (the-as muse self)) + (none) + ) ) ;; definition for method 32 of type sculptor @@ -248,8 +251,8 @@ :code (behavior () (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (get-art-elem self) ) (ja-channel-push! 1 60) diff --git a/test/decompiler/reference/levels/beach/seagull_REF.gc b/test/decompiler/reference/levels/beach/seagull_REF.gc index 27a15a2263..76f20c13eb 100644 --- a/test/decompiler/reference/levels/beach/seagull_REF.gc +++ b/test/decompiler/reference/levels/beach/seagull_REF.gc @@ -1134,15 +1134,14 @@ (go seagull-flying) ) (when (< (-> self root-override trans y) 204800.0) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) - (let* ((f30-1 0.99) - (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) - (v1-68 (the-as number (logior #x3f800000 v1-67))) - ) - (< f30-1 (+ -1.0 (the-as float v1-68))) - ) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (let* ((f30-1 0.99) + (v1-67 (/ (the-as int (rand-uint31-gen *random-generator*)) 256)) + (v1-68 (the-as number (logior #x3f800000 v1-67))) + ) + (< f30-1 (+ -1.0 (the-as float v1-68))) + ) + ) (go seagull-flying) ) ) @@ -1640,11 +1639,11 @@ (defun-debug beach-rock-trigger () (let ((gp-0 600)) (set! (-> (the-as - seagullflock - (search-process-tree *active-pool* (lambda ((arg0 process)) (= (-> arg0 type) seagullflock))) - ) - teleport-frames - ) + seagullflock + (search-process-tree *active-pool* (lambda ((arg0 process)) (= (-> arg0 type) seagullflock))) + ) + teleport-frames + ) gp-0 ) gp-0 diff --git a/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc b/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc index c7e8c9e199..1829cecfe2 100644 --- a/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc +++ b/test/decompiler/reference/levels/citadel/assistant-citadel_REF.gc @@ -85,10 +85,9 @@ (behavior () (dummy-33 self) ((-> (method-of-type process-taskable hidden) trans)) - (when (and - (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) - ) + (when (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (not (closed? (-> self tasks) (game-task village4-button) (task-status need-reward-speech))) + ) ) (none) ) @@ -111,8 +110,8 @@ (behavior () (while #t (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (get-art-elem self) ) (ja-channel-push! 1 15) @@ -126,12 +125,12 @@ ) ) (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -163,10 +162,9 @@ (defmethod should-display? assistant-lavatube-end ((obj assistant-lavatube-end)) (first-any (-> obj tasks) #t) (let ((v1-3 (current-status (-> obj tasks)))) - (and - (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) - (not (task-closed? (game-task citadel-sage-green) (task-status need-hint))) - ) + (and (or (= v1-3 (task-status need-reward-speech)) (= v1-3 (task-status invalid))) + (not (task-closed? (game-task citadel-sage-green) (task-status need-hint))) + ) ) ) diff --git a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc index c54545d3ad..f84d554f14 100644 --- a/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-obs_REF.gc @@ -1257,7 +1257,11 @@ ;; failed to figure out what this is: (defstate citb-robotboss-die (citb-robotboss) :code - (behavior () (dummy-18 self) (deactivate self) (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (none) + ) ) ;; definition for method 11 of type citb-robotboss @@ -1352,12 +1356,13 @@ ;; failed to figure out what this is: (defstate citb-coil-idle (citb-coil) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go citb-coil-break) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go citb-coil-break) + ) + ) + ) :code (behavior () (while #t @@ -1367,12 +1372,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1399,7 +1404,11 @@ (none) ) :post - (behavior () (spawn (-> self part) (-> self root trans)) (ja-post) (none)) + (behavior () + (spawn (-> self part) (-> self root trans)) + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -1848,7 +1857,10 @@ ) ) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :code (behavior () (lods-assign! (-> self draw) (-> self normal-look)) @@ -1974,7 +1986,11 @@ (none) ) :post - (behavior () (spawn (-> self part-broken) (-> self root-override trans)) (ja-post) (none)) + (behavior () + (spawn (-> self part-broken) (-> self root-override trans)) + (ja-post) + (none) + ) ) ;; definition for method 20 of type citb-generator @@ -2106,11 +2122,10 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) - (when (and - (task-complete? *game-info* (game-task citadel-sage-blue)) - (task-complete? *game-info* (game-task citadel-sage-red)) - (task-complete? *game-info* (game-task citadel-sage-yellow)) - ) + (when (and (task-complete? *game-info* (game-task citadel-sage-blue)) + (task-complete? *game-info* (game-task citadel-sage-red)) + (task-complete? *game-info* (game-task citadel-sage-yellow)) + ) (logclear! (-> self mask) (process-mask actor-pause)) (go citadelcam-stair-plats) ) @@ -2118,7 +2133,11 @@ ) ) :code - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (anim-loop) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (anim-loop) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc index a49c30a31a..6d34a4b8fb 100644 --- a/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc +++ b/test/decompiler/reference/levels/citadel/citadel-sages_REF.gc @@ -1344,10 +1344,9 @@ :trans (behavior () (cond - ((and - *target* - (and (< (-> (target-pos 0) z) -18821530.0) (= (current-status (-> self tasks)) (task-status need-hint))) - ) + ((and *target* + (and (< (-> (target-pos 0) z) -18821530.0) (= (current-status (-> self tasks)) (task-status need-hint))) + ) (send-event self 'play-anim) ) ((= (-> self which-movie) 1) diff --git a/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc b/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc index 94df1408e9..e1afd85922 100644 --- a/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-drop-plat-CIT_REF.gc @@ -136,12 +136,13 @@ ;; failed to figure out what this is: (defstate drop-plat-spawn (drop-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('drop) - (go drop-plat-die) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('drop) + (go drop-plat-die) + ) + ) + ) :code (behavior () (set! (-> self root-override trans y) @@ -168,12 +169,13 @@ ;; failed to figure out what this is: (defstate drop-plat-rise (drop-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('drop) - (go drop-plat-drop) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('drop) + (go drop-plat-drop) + ) + ) + ) :code (behavior ((arg0 draw-control)) (set! (-> self interp) 1.0) @@ -243,8 +245,8 @@ (vector-v++! (-> self root-override transv) (dummy-62 (-> self root-override) (new-stack-vector0) 0.0)) (vector-v++! (-> self root-override trans) (-> self root-override transv)) (if (< 204800.0 - (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) - ) + (- (-> (the-as process-drawable (-> self parent 0)) root trans y) (-> self root-override trans y)) + ) (go drop-plat-die) ) (+! (-> self spin-angle) (* (-> self spin-speed) (-> *display* seconds-per-frame))) @@ -267,7 +269,10 @@ ;; failed to figure out what this is: (defstate drop-plat-die (drop-plat) :code - (behavior () (dummy-18 self) (none)) + (behavior () + (dummy-18 self) + (none) + ) ) ;; definition for method 20 of type drop-plat @@ -532,12 +537,13 @@ ;; failed to figure out what this is: (defstate citb-drop-plat-idle (citb-drop-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go citb-drop-plat-active) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go citb-drop-plat-active) + ) + ) + ) :code (behavior () (citb-drop-plat-drop-all-children) @@ -572,12 +578,10 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (citb-drop-plat-spawn-children) (while #t - (if (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) 600)) - (or - (not *target*) - (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) + (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) (+ (-> self duration) 600)) + (or (not *target*) + (< (-> self idle-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + ) (not (-> self child)) ) (go citb-drop-plat-idle) diff --git a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc index c6c7efe3f1..e98cfa6d07 100644 --- a/test/decompiler/reference/levels/citadel/citb-plat_REF.gc +++ b/test/decompiler/reference/levels/citadel/citb-plat_REF.gc @@ -70,9 +70,9 @@ :trans (behavior () (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go-virtual citb-base-plat-active) ) (none) @@ -89,9 +89,9 @@ :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go-virtual citb-base-plat-idle) ) (rider-trans) @@ -311,15 +311,15 @@ (set! (-> obj draw bounds w) (* (-> obj draw bounds w) f0-0)) ) (set! (-> obj trans-offset quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - (-> obj entity) - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + (-> obj entity) + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) quad ) ) @@ -447,11 +447,10 @@ ;; definition for method 24 of type citb-stair-plat ;; INFO: Return type mismatch int vs none. (defmethod dummy-24 citb-stair-plat ((obj citb-stair-plat)) - (if (and - (task-complete? *game-info* (game-task citadel-sage-blue)) - (task-complete? *game-info* (game-task citadel-sage-red)) - (task-complete? *game-info* (game-task citadel-sage-yellow)) - ) + (if (and (task-complete? *game-info* (game-task citadel-sage-blue)) + (task-complete? *game-info* (game-task citadel-sage-red)) + (task-complete? *game-info* (game-task citadel-sage-yellow)) + ) (go (method-of-object obj citb-base-plat-active)) (go (method-of-object obj citb-base-plat-idle)) ) @@ -560,20 +559,22 @@ (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) (set! (-> self state-time) (-> *display* base-frame-counter)) - (if (and - (and *target* (>= (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) - ) - (send-event *target* 'query 'powerup 3) - ) + (if (and (and *target* (>= (-> self info idle-distance) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) + ) + (send-event *target* 'query 'powerup 3) + ) (go-virtual rigid-body-platform-float) ) ) (none) ) :code - (behavior () (anim-loop) (none)) + (behavior () + (anim-loop) + (none) + ) :post (the-as (function none :behavior citb-chain-plat) ja-post) ) @@ -587,21 +588,25 @@ rigid-body-platform-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :trans (behavior () (cond - ((and - (and - *target* - (>= (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) - ) - (send-event *target* 'query 'powerup 3) - ) + ((and (and *target* + (>= (-> self info idle-distance) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) + ) + (send-event *target* 'query 'powerup 3) + ) (when (< (- (-> *display* base-frame-counter) (-> self state-time)) 300) (if (rand-vu-percent? 0.05) (spawn-projectile-blue *target*) @@ -627,7 +632,10 @@ (none) ) :code - (behavior () (anim-loop) (none)) + (behavior () + (anim-loop) + (none) + ) :post (the-as (function none :behavior citb-chain-plat) rigid-body-platform-post) ) @@ -779,12 +787,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -808,9 +816,9 @@ ) ) (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go-virtual citb-base-plat-idle) ) ) @@ -1080,9 +1088,9 @@ :trans (behavior () (if (and *target* (>= (-> self idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go citb-firehose-active) ) (none) @@ -1103,9 +1111,9 @@ :trans (behavior () (if (or (not *target*) (< (+ 8192.0 (-> self idle-distance)) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go citb-firehose-idle) ) (let ((f0-2 (get-current-phase (-> self sync))) diff --git a/test/decompiler/reference/levels/common/babak-with-cannon_REF.gc b/test/decompiler/reference/levels/common/babak-with-cannon_REF.gc index 97642e5f26..aba1f7d9e7 100644 --- a/test/decompiler/reference/levels/common/babak-with-cannon_REF.gc +++ b/test/decompiler/reference/levels/common/babak-with-cannon_REF.gc @@ -35,13 +35,12 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - ) + (if (and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + ) (go-virtual nav-enemy-patrol) ) (none) @@ -94,24 +93,21 @@ nav-enemy-default-event-handler (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) (let ((f30-0 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - (or - (or - (not *target*) - (< (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) - ) - (< f30-0 -40960.0) - ) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + (or (or (not *target*) + (< (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) + ) + (< f30-0 -40960.0) + ) + ) (go babak-run-to-cannon) ) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (if (or (not *target*) (< (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) (go-virtual nav-enemy-idle) ) ) @@ -174,7 +170,10 @@ nav-enemy-default-event-handler (none) ) :post - (behavior () (nav-enemy-travel-post) (none)) + (behavior () + (nav-enemy-travel-post) + (none) + ) ) ;; definition for function handle->process-safe @@ -238,7 +237,10 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 24) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 24) + (none) + ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -326,7 +328,10 @@ nav-enemy-default-event-handler nav-enemy-jump-event-handler ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 24) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 24) + (none) + ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -395,16 +400,13 @@ nav-enemy-default-event-handler :trans (behavior () (let ((f0-1 (- (-> (target-pos 0) y) (-> self collide-info trans y)))) - (if (and - (< -40960.0 f0-1) - (and - (and - *target* - (>= (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - ) - ) + (if (and (< -40960.0 f0-1) + (and (and *target* + (>= (-> self distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + ) + ) (go babak-with-cannon-jump-off-cannon) ) ) @@ -511,8 +513,7 @@ nav-enemy-default-event-handler (set! (-> obj distance) (res-lump-float arg0 'distance :default 163840.0)) (set! (-> obj cannon-ent) (entity-actor-lookup (-> obj entity) 'alt-actor 0)) (logclear! (-> obj mask) (process-mask actor-pause)) - (if (or - (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) + (if (or (not (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete)))) (zero? (logand (-> obj enemy-info options) (fact-options fop1))) ) (go (method-of-object obj nav-enemy-idle)) diff --git a/test/decompiler/reference/levels/common/babak_REF.gc b/test/decompiler/reference/levels/common/babak_REF.gc index 3fdf7e57eb..e0343de78f 100644 --- a/test/decompiler/reference/levels/common/babak_REF.gc +++ b/test/decompiler/reference/levels/common/babak_REF.gc @@ -35,8 +35,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 10) ) (ja-channel-push! 1 45) @@ -75,8 +75,8 @@ (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 14) ) (let ((a0-5 (-> self skel root-channel 0))) @@ -142,10 +142,9 @@ (behavior () (set! (-> self turn-time) 60) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or - (logtest? (-> self nav-enemy-flags) 256) - (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - ) + (when (or (logtest? (-> self nav-enemy-flags) 256) + (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) + ) (ja-channel-push! 1 30) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 11))) @@ -189,11 +188,11 @@ (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) ) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) + ) (ja-channel-push! 1 60) ) (let ((a0-23 (-> self skel root-channel 0))) @@ -249,8 +248,8 @@ (s5-0 (target-pos 0)) ) (when (< (fabs - (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) - ) + (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) + ) 12743.111 ) (let ((a0-6 (-> self skel root-channel 0))) @@ -461,10 +460,9 @@ ;; INFO: Return type mismatch int vs none. (defmethod TODO-RENAME-59 babak ((obj babak)) (cond - ((and - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (logtest? (-> obj enemy-info options) (fact-options fop1)) - ) + ((and (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (logtest? (-> obj enemy-info options) (fact-options fop1)) + ) (go (method-of-object obj nav-enemy-fuel-cell)) ) ((logtest? (-> obj enemy-info options) (fact-options fop5)) diff --git a/test/decompiler/reference/levels/common/basebutton_REF.gc b/test/decompiler/reference/levels/common/basebutton_REF.gc index 11fc373a86..27a03c543f 100644 --- a/test/decompiler/reference/levels/common/basebutton_REF.gc +++ b/test/decompiler/reference/levels/common/basebutton_REF.gc @@ -120,7 +120,10 @@ ) ) :enter - (behavior () (press! self #f) (none)) + (behavior () + (press! self #f) + (none) + ) :trans (behavior () (if (-> self move-to?) @@ -158,7 +161,10 @@ ) ) :enter - (behavior () (press! self #t) (none)) + (behavior () + (press! self #t) + (none) + ) :trans (the-as (function none :behavior basebutton) rider-trans) :code @@ -208,7 +214,10 @@ ) ) :enter - (behavior () (press! self #t) (none)) + (behavior () + (press! self #t) + (none) + ) :trans (behavior () (if (-> self move-to?) @@ -262,7 +271,10 @@ ) ) :enter - (behavior () (press! self #f) (none)) + (behavior () + (press! self #f) + (none) + ) :trans (the-as (function none :behavior basebutton) rider-trans) :code @@ -553,7 +565,10 @@ (defstate use (warp-gate) :virtual #t :trans - (behavior () (send-event *camera* 'joystick 0.0 0.0) (none)) + (behavior () + (send-event *camera* 'joystick 0.0 0.0) + (none) + ) :code (behavior ((arg0 int) (arg1 level)) (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -581,10 +596,9 @@ ) (else (load-state-want-levels (-> self level) (-> arg1 load-name)) - (while (or - (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 600) - ) + (while (or (not (member (level-status *level* (-> arg1 load-name)) '(loaded active))) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 600) + ) (suspend) ) ) @@ -654,7 +668,10 @@ (none) ) :exit - (behavior () (set! (-> self state-flags) (logand -1025 (-> self state-flags))) (none)) + (behavior () + (set! (-> self state-flags) (logand -1025 (-> self state-flags))) + (none) + ) :code (behavior ((arg0 vector) (arg1 vector)) (send-event *camera* 'change-state cam-fixed 0) @@ -685,14 +702,14 @@ (f1-1 f0-7) (f2-4 (- (sqrtf - (* 2.0 - (-> self control dynam gravity-length) - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector102) (-> self control trans)) - ) - ) - ) + (* 2.0 + (-> self control dynam gravity-length) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector102) (-> self control trans)) + ) + ) + ) (* 0.008333334 (- (-> self control dynam gravity-length))) ) ) @@ -730,10 +747,9 @@ (let ((gp-2 (vector-! (new-stack-vector0) (-> self control unknown-vector102) (-> self control trans)))) (set! (-> gp-2 y) 0.0) (send-event *target* 'sidekick #f) - (when (and - (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) - ) + (when (and (or (< (vector-dot gp-2 (-> self control transv)) 0.0) (-> self control unknown-spoolanim00)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) + ) (vector-seek! (-> self draw color-mult) (new 'static 'vector) (* 2.0 (-> *display* seconds-per-frame))) (set! (-> self control transv x) (* 0.95 (-> self control transv x))) (set! (-> self control transv z) (* 0.95 (-> self control transv z))) diff --git a/test/decompiler/reference/levels/common/baseplat_REF.gc b/test/decompiler/reference/levels/common/baseplat_REF.gc index 4411044933..86d17f80d2 100644 --- a/test/decompiler/reference/levels/common/baseplat_REF.gc +++ b/test/decompiler/reference/levels/common/baseplat_REF.gc @@ -227,21 +227,19 @@ eco-door-event-handler ) ) (dummy-26 self) - (if (and - (not (-> self locked)) - (or - (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (send-event-function *target* a1-1) - ) - (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)) - ) - ) + (if (and (not (-> self locked)) + (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'powerup)) + (set! (-> a1-1 param 1) (the-as uint 3)) + (send-event-function *target* a1-1) + ) + (and (-> self one-way) (< (vector4-dot (-> self out-dir) (target-pos 0)) -8192.0)) + ) + ) (go-virtual door-opening) ) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) @@ -260,10 +258,9 @@ eco-door-event-handler :code (behavior () (let ((gp-0 - (and - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (send-event *target* 'query 'powerup 3) - ) + (and (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (send-event *target* 'query 'powerup 3) + ) ) ) (if gp-0 @@ -320,13 +317,12 @@ eco-door-event-handler (let ((f30-0 (vector4-dot (-> self out-dir) (target-pos 0))) (f28-0 (vector4-dot (-> self out-dir) (camera-pos))) ) - (when (and - (-> self auto-close) - (or (not *target*) (< (-> self close-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - ) + (when (and (-> self auto-close) + (or (not *target*) (< (-> self close-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + ) (if (and (>= (* f30-0 f28-0) 0.0) (< 16384.0 (fabs f28-0))) (go-virtual door-closing) ) @@ -440,11 +436,10 @@ eco-door-event-handler (set! (-> obj out-dir w) (- (vector-dot (-> obj out-dir) (-> obj root-override trans)))) (dummy-47 (-> obj root-override)) (TODO-RENAME-25 obj) - (if (and - (not (-> obj auto-close)) - (-> obj entity) - (logtest? (-> obj entity extra perm status) (entity-perm-status complete)) - ) + (if (and (not (-> obj auto-close)) + (-> obj entity) + (logtest? (-> obj entity extra perm status) (entity-perm-status complete)) + ) (go (method-of-object obj door-open)) (go (method-of-object obj door-closed)) ) diff --git a/test/decompiler/reference/levels/common/battlecontroller_REF.gc b/test/decompiler/reference/levels/common/battlecontroller_REF.gc index 569a12aabe..469cb0d3ba 100644 --- a/test/decompiler/reference/levels/common/battlecontroller_REF.gc +++ b/test/decompiler/reference/levels/common/battlecontroller_REF.gc @@ -465,7 +465,10 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :trans - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -475,10 +478,9 @@ battlecontroller-default-event-handler (while #t (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) (set! (-> self state-time) (-> *display* base-frame-counter)) - (when (and - *target* - (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) + (when (and *target* + (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + ) (set! (-> self noticed-player) #t) (battlecontroller-battle-begin) (when (not (-> self prespawn)) @@ -503,11 +505,20 @@ battlecontroller-default-event-handler :event battlecontroller-default-event-handler :enter - (behavior () (process-entity-status! self (entity-perm-status bit-3) #t) (none)) + (behavior () + (process-entity-status! self (entity-perm-status bit-3) #t) + (none) + ) :exit - (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none)) + (behavior () + (process-entity-status! self (entity-perm-status bit-3) #f) + (none) + ) :code - (behavior () (go-virtual battlecontroller-active) (none)) + (behavior () + (go-virtual battlecontroller-active) + (none) + ) ) ;; definition for function battlecontroller-disable-ocean @@ -527,10 +538,9 @@ battlecontroller-default-event-handler battlecontroller-default-event-handler :trans (behavior () - (if (and - *target* - (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) + (if (and *target* + (>= (-> self activate-distance) (vector-vector-distance (-> self root trans) (-> *target* control trans))) + ) (level-hint-spawn (game-text-id zero) (the-as string #f) (-> self entity) *entity-pool* (game-task none)) ) (battlecontroller-disable-ocean) diff --git a/test/decompiler/reference/levels/common/joint-exploder_REF.gc b/test/decompiler/reference/levels/common/joint-exploder_REF.gc index a7d696a458..9ffeed4e9a 100644 --- a/test/decompiler/reference/levels/common/joint-exploder_REF.gc +++ b/test/decompiler/reference/levels/common/joint-exploder_REF.gc @@ -478,10 +478,9 @@ (set! (-> s2-0 rmat vector 1 y) (+ (* f3-0 f2-1) (* f1-2 f0-3))) ) (cond - ((or - (< (-> s1-0 y) (-> obj die-if-below-y)) - (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) - ) + ((or (< (-> s1-0 y) (-> obj die-if-below-y)) + (< (-> obj die-if-beyond-xz-dist-sqrd) (vector-vector-xz-distance s1-0 (-> obj root trans))) + ) (set! s3-0 (TODO-RENAME-24 obj arg0 s3-0)) ) (else @@ -534,7 +533,10 @@ ;; failed to figure out what this is: (defstate joint-exploder-shatter (joint-exploder) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (let* ((f1-0 (the float (- (-> *display* base-frame-counter) (-> self state-time)))) @@ -665,10 +667,9 @@ (-> s3-0 transv) (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi x) (-> obj tuning fountain-rand-transv-hi y)) ) - (+! - (-> s3-0 transv y) - (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) - ) + (+! (-> s3-0 transv y) + (rand-vu-float-range (-> obj tuning fountain-rand-transv-hi z) (-> obj tuning fountain-rand-transv-hi w)) + ) (set! (-> s3-0 transv w) 1.0) ) (else diff --git a/test/decompiler/reference/levels/common/launcherdoor_REF.gc b/test/decompiler/reference/levels/common/launcherdoor_REF.gc index 5be5d7d5d7..7cab9c300d 100644 --- a/test/decompiler/reference/levels/common/launcherdoor_REF.gc +++ b/test/decompiler/reference/levels/common/launcherdoor_REF.gc @@ -76,11 +76,10 @@ ) (suspend) (while #t - (if (and - *target* - (= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (-> *target* control trans y) (-> self thresh-y)) - ) + (if (and *target* + (= (-> *target* control unknown-surface00 name) 'launch-jump) + (< (-> *target* control trans y) (-> self thresh-y)) + ) (go launcherdoor-open #f) ) (let ((a0-13 (-> self skel root-channel 0))) @@ -145,11 +144,10 @@ ) ) (while #t - (when (or - (not *target*) - (!= (-> *target* control unknown-surface00 name) 'launch-jump) - (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) - ) + (when (or (not *target*) + (!= (-> *target* control unknown-surface00 name) 'launch-jump) + (< (+ 4096.0 (-> self root-override trans y)) (-> *target* control trans y)) + ) (when (and *target* (< (-> self thresh-y) (-> *target* control trans y))) (let ((a1-3 (res-lump-struct (-> self entity) 'continue-name structure))) (when a1-3 @@ -198,11 +196,11 @@ (process-drawable-from-entity! obj arg0) (cond ((= (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) + (-> obj entity extra level) + (-> *level* level-default) + ) + name + ) 'maincave ) (set! (-> obj close-speed) 4.0) @@ -237,9 +235,9 @@ ) ) (set! (-> obj load-mode) (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) + (-> obj entity extra level) + (-> *level* level-default) + ) name ) ) diff --git a/test/decompiler/reference/levels/common/mistycannon_REF.gc b/test/decompiler/reference/levels/common/mistycannon_REF.gc index a8cd18881a..138ce4efe1 100644 --- a/test/decompiler/reference/levels/common/mistycannon_REF.gc +++ b/test/decompiler/reference/levels/common/mistycannon_REF.gc @@ -866,15 +866,14 @@ (restore-collide-with-as (-> self root-override)) (set-vector! (-> self root-override scale) 0.6 0.6 0.6 1.0) (while (zero? (logand (-> self root-override status) 1)) - (if (and - (zero? (-> self sfx)) - (< (if *target* + (if (and (zero? (-> self sfx)) + (< (if *target* (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) 4096000.0 ) - 409600.0 - ) - ) + 409600.0 + ) + ) (set! (-> self sfx) (the-as uint @@ -1552,13 +1551,12 @@ (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) - (if (and - (-> self postbindinfo-ok) - *target* - (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (if (and (-> self postbindinfo-ok) + *target* + (>= (-> self fact-info-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go mistycannon-aim-at-player) ) (rider-trans) @@ -1766,17 +1764,20 @@ ;; failed to figure out what this is: (defstate mistycannon-aim-at-player (mistycannon) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) (go mistycannon-waiting-for-player) ) (if (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + ) (go mistycannon-idle) ) (rider-trans) @@ -1924,9 +1925,17 @@ ) ) :exit - (behavior () (sound-stop (-> self sound-id)) (sound-stop (-> self aim-sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (sound-stop (-> self aim-sound-id)) + (none) + ) :trans - (behavior () (dummy-23 self) (rider-trans) (none)) + (behavior () + (dummy-23 self) + (rider-trans) + (none) + ) :code (behavior () (send-event *camera* 'change-state cam-mistycannon 0) @@ -1981,10 +1990,9 @@ #t ) ) - (when (or - (= gp-0 300) - (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) - ) + (when (or (= gp-0 300) + (and (zero? (logand (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons x))) (nonzero? gp-0)) + ) (let ((gp-1 (+ 50 (the int (* 0.16666667 (the float gp-0)))))) (level-hint-spawn (game-text-id daxter-get-some) "sksp009f" (the-as entity #f) *entity-pool* (game-task none)) (dummy-22 self (* 4096.0 (the float gp-1)) 2.0 40960.0) @@ -2039,7 +2047,10 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (the-as (function none :behavior mistycannon) rider-trans) :code diff --git a/test/decompiler/reference/levels/common/nav-enemy_REF.gc b/test/decompiler/reference/levels/common/nav-enemy_REF.gc index 2a2abdf851..98ae5fb3b1 100644 --- a/test/decompiler/reference/levels/common/nav-enemy_REF.gc +++ b/test/decompiler/reference/levels/common/nav-enemy_REF.gc @@ -79,14 +79,12 @@ ;; definition for method 39 of type nav-enemy ;; INFO: Return type mismatch int vs none. (defmethod common-post nav-enemy ((obj nav-enemy)) - (when (and - (logtest? (-> obj nav-enemy-flags) 256) - (or (not *target*) (and - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) 15) - ) - ) - ) + (when (and (logtest? (-> obj nav-enemy-flags) 256) + (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) + (>= (- (-> *display* base-frame-counter) (-> obj touch-time)) 15) + ) + ) + ) (dummy-54 (-> obj collide-info) 2 1) (set! (-> obj nav-enemy-flags) (logand -257 (-> obj nav-enemy-flags))) ) @@ -119,11 +117,11 @@ ;; definition for method 44 of type nav-enemy (defmethod dummy-44 nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) ) @@ -131,11 +129,11 @@ ;; definition for method 72 of type nav-enemy (defmethod nav-enemy-touch-handler nav-enemy ((obj nav-enemy) (arg0 process) (arg1 event-message-block)) (if (and (logtest? (-> obj nav-enemy-flags) 64) ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - ) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + ) (nav-enemy-send-attack arg0 (the-as touching-shapes-entry (-> arg1 param 0)) 'generic) ) ) @@ -526,17 +524,14 @@ nav-enemy-default-event-handler ;; definition for method 46 of type nav-enemy (defmethod TODO-RENAME-46 nav-enemy ((obj nav-enemy) (arg0 float)) - (and - *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (and - (or - (zero? (logand (-> obj nav-enemy-flags) 4096)) - (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) - ) - (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) - ) - ) + (and *target* + (zero? (logand (-> *target* state-flags) #x80f8)) + (and (or (zero? (logand (-> obj nav-enemy-flags) 4096)) + (< (vector-vector-distance (target-pos 0) (-> obj collide-info trans)) arg0) + ) + (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) + ) + ) ) ;; definition for function nav-enemy-notice-player? @@ -550,16 +545,14 @@ nav-enemy-default-event-handler ) ) (else - (when (or - (TODO-RENAME-46 self (-> self nav-info notice-distance)) - (and - (-> self nav-info use-proximity-notice) - *target* - (>= (-> self nav-info proximity-notice-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) + (when (or (TODO-RENAME-46 self (-> self nav-info notice-distance)) + (and (-> self nav-info use-proximity-notice) + *target* + (>= (-> self nav-info proximity-notice-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) ) - ) (logior! (-> self nav-enemy-flags) 1) (set! (-> self notice-time) (-> *display* base-frame-counter)) ) @@ -603,19 +596,17 @@ nav-enemy-default-event-handler ;; definition for function nav-enemy-test-point-in-nav-mesh? ;; INFO: Return type mismatch structure vs symbol. (defbehavior nav-enemy-test-point-in-nav-mesh? nav-enemy ((arg0 vector)) - (the-as symbol (and - (dummy-16 (-> self nav) arg0) - (< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top))) - ) + (the-as symbol (and (dummy-16 (-> self nav) arg0) + (< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top))) + ) ) ) ;; definition for function nav-enemy-test-point-near-nav-mesh? (defbehavior nav-enemy-test-point-near-nav-mesh? nav-enemy ((arg0 vector)) - (and - (dummy-25 (-> self nav) arg0 (-> self nav-info notice-nav-radius)) - (< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top))) - ) + (and (dummy-25 (-> self nav) arg0 (-> self nav-info notice-nav-radius)) + (< (-> arg0 y) (+ (-> self collide-info trans y) (-> self enemy-info notice-top))) + ) ) ;; definition for function nav-enemy-get-new-patrol-point @@ -644,19 +635,17 @@ nav-enemy-default-event-handler ) ) (when v1-6 - (if (or - (not s5-1) + (if (or (not s5-1) (< (-> (the-as collide-shape-prim-sphere v1-6) transform-index) (-> (the-as collide-shape-prim-group s5-1) transform-index) ) - (and - (= (-> (the-as collide-shape-prim-sphere v1-6) transform-index) - (-> (the-as collide-shape-prim-group s5-1) transform-index) + (and (= (-> (the-as collide-shape-prim-sphere v1-6) transform-index) + (-> (the-as collide-shape-prim-group s5-1) transform-index) + ) + (< (-> (the-as collide-shape-prim-sphere v1-6) local-sphere y) + (-> (the-as collide-shape-prim-group s5-1) local-sphere y) + ) ) - (< (-> (the-as collide-shape-prim-sphere v1-6) local-sphere y) - (-> (the-as collide-shape-prim-group s5-1) local-sphere y) - ) - ) ) (set! s5-1 v1-6) ) @@ -799,22 +788,18 @@ nav-enemy-default-event-handler ;; definition for method 12 of type nav-enemy (defmethod run-logic? nav-enemy ((obj nav-enemy)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (and - (nonzero? (-> obj draw)) - (and - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (camera-pos)) - ) - (or (logtest? (-> obj draw status) (draw-status drwf03)) (!= (-> obj next-state name) 'nav-enemy-idle)) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (and (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) + (vector-vector-distance (-> obj collide-info trans) (camera-pos)) + ) + (or (logtest? (-> obj draw status) (draw-status drwf03)) (!= (-> obj next-state name) 'nav-enemy-idle)) + ) + ) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status drwf04))) ) - ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status drwf04))) ) - ) ) ;; failed to figure out what this is: @@ -838,15 +823,14 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - (nonzero? (-> self draw)) - (logtest? (-> self draw status) (draw-status drwf03)) - ) + (if (and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (nonzero? (-> self draw)) + (logtest? (-> self draw status) (draw-status drwf03)) + ) (go-virtual nav-enemy-patrol) ) (none) @@ -902,7 +886,10 @@ nav-enemy-default-event-handler (none) ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 8) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 8) + (none) + ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) @@ -910,8 +897,7 @@ nav-enemy-default-event-handler (if (and (nonzero? (-> self draw)) (logtest? (-> self draw status) (draw-status drwf03))) (set! (-> self free-time) (-> *display* base-frame-counter)) ) - (if (or - (or (not *target*) (< (-> self enemy-info idle-distance) + (if (or (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) @@ -920,24 +906,22 @@ nav-enemy-default-event-handler (go-virtual nav-enemy-idle) ) ) - (if (and - (-> self nav-info use-flee) - (and - (and *target* (>= (-> self nav-info notice-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (let ((gp-0 'racer) - (a1-2 (new 'stack-no-clear 'event-message-block)) + (if (and (-> self nav-info use-flee) + (and (and *target* (>= (-> self nav-info notice-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (let ((gp-0 'racer) + (a1-2 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 1) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'mode)) + (= gp-0 (send-event-function *target* a1-2)) ) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 1) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'mode)) - (= gp-0 (send-event-function *target* a1-2)) - ) - ) - ) + ) + ) (go-virtual nav-enemy-flee) ) (if (nav-enemy-notice-player?) @@ -1148,8 +1132,8 @@ nav-enemy-default-event-handler ;; definition for function ja-group-index? (defbehavior ja-group-index? nav-enemy ((arg0 int)) (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data arg0) ) ) @@ -1163,12 +1147,14 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) - (if (or - (or (not *target*) (< (-> self nav-info stop-chase-distance) + (if (or (or (not *target*) (< (-> self nav-info stop-chase-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) @@ -1305,8 +1291,7 @@ nav-enemy-default-event-handler (if (logtest? (-> self nav-enemy-flags) 256) (go-virtual nav-enemy-victory) ) - (if (or - (not (nav-enemy-player-at-frustration-point?)) + (if (or (not (nav-enemy-player-at-frustration-point?)) (< (-> self nav-info frustration-distance) (vector-vector-xz-distance (target-pos 0) (-> self collide-info trans)) ) @@ -1315,12 +1300,11 @@ nav-enemy-default-event-handler ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self reaction-time)) (if (>= (- (-> *display* base-frame-counter) (-> self frustration-time)) - (+ (-> self reaction-time) (-> self nav-info frustration-time)) - ) + (+ (-> self reaction-time) (-> self nav-info frustration-time)) + ) (logior! (-> self nav-enemy-flags) 8192) ) - (if (or - (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) + (if (or (not (TODO-RENAME-46 self (-> self nav-info stop-chase-distance))) (logtest? (-> self nav-enemy-flags) 8192) ) (go-virtual nav-enemy-stop-chase) @@ -1397,8 +1381,7 @@ nav-enemy-default-event-handler (if (and (TODO-RENAME-46 self (-> self nav-info notice-distance)) (not (nav-enemy-frustrated?))) (go-virtual nav-enemy-chase) ) - (if (or - (or (not *target*) (< (-> self enemy-info idle-distance) + (if (or (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) @@ -1460,7 +1443,10 @@ nav-enemy-default-event-handler (none) ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 16) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 16) + (none) + ) :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) @@ -1469,10 +1455,9 @@ nav-enemy-default-event-handler ) (cond ((TODO-RENAME-46 self (-> self nav-info notice-distance)) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) - (not (nav-enemy-frustrated?)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) + (not (nav-enemy-frustrated?)) + ) (go-virtual nav-enemy-chase) ) ) @@ -1481,24 +1466,21 @@ nav-enemy-default-event-handler ) ) (when (not - (or - (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) - (and - (-> self nav-info use-proximity-notice) - *target* - (>= (-> self nav-info proximity-notice-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) + (or (and *target* (>= 40960.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) + (and (-> self nav-info use-proximity-notice) + *target* + (>= (-> self nav-info proximity-notice-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) ) - ) ) (set! (-> self nav-enemy-flags) (logand -5 (-> self nav-enemy-flags))) (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) (go-virtual nav-enemy-give-up) ) ) - (if (or - (or (not *target*) (< (-> self enemy-info idle-distance) + (if (or (or (not *target*) (< (-> self enemy-info idle-distance) (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) ) ) @@ -1510,7 +1492,10 @@ nav-enemy-default-event-handler (none) ) :code - (behavior () (go-virtual nav-enemy-give-up) (none)) + (behavior () + (go-virtual nav-enemy-give-up) + (none) + ) :post nav-enemy-face-player-post ) @@ -1540,7 +1525,10 @@ nav-enemy-default-event-handler (none) ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) :post nav-enemy-simple-post ) @@ -1554,7 +1542,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-victory) (none)) + (behavior () + (go-virtual nav-enemy-victory) + (none) + ) :post nav-enemy-simple-post ) @@ -1568,7 +1559,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set! (-> self collide-info transv quad) (-> *null-vector* quad)) (none)) + (behavior () + (set! (-> self collide-info transv quad) (-> *null-vector* quad)) + (none) + ) :code (behavior () (ja-channel-push! 1 22) @@ -1617,7 +1611,10 @@ nav-enemy-default-event-handler process-drawable-death-event-handler ) :enter - (behavior () (send-event (ppointer->process (-> self parent)) 'child-die) (none)) + (behavior () + (send-event (ppointer->process (-> self parent)) 'child-die) + (none) + ) :code (behavior () (ja-channel-push! 1 22) @@ -1794,8 +1791,8 @@ nav-enemy-default-event-handler ((logtest? (-> self nav-enemy-flags) 1024) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data (-> self nav-info run-anim)) ) ) @@ -1918,7 +1915,10 @@ nav-enemy-default-event-handler (none) ) :exit - (behavior () (logior! (-> self nav-enemy-flags) 24) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 24) + (none) + ) :code (behavior () (nav-enemy-execute-jump) @@ -2007,8 +2007,7 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) (logtest? (nav-control-flags bit19) (-> self nav flags)) ) (go-virtual nav-enemy-chase) @@ -2016,7 +2015,11 @@ nav-enemy-default-event-handler (none) ) :code - (behavior () (nav-enemy-jump-land-anim) (go (-> self jump-return-state)) (none)) + (behavior () + (nav-enemy-jump-land-anim) + (go (-> self jump-return-state)) + (none) + ) :post nav-enemy-jump-land-post ) @@ -2030,7 +2033,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) @@ -2041,8 +2047,8 @@ nav-enemy-default-event-handler :code (behavior () (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data (-> self nav-info idle-anim)) ) ) @@ -2055,12 +2061,12 @@ nav-enemy-default-event-handler ) (set! (-> gp-0 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2140,9 +2146,15 @@ nav-enemy-default-event-handler :event nav-enemy-jump-event-handler :exit - (behavior () (logior! (-> self nav-enemy-flags) 24) (none)) + (behavior () + (logior! (-> self nav-enemy-flags) 24) + (none) + ) :trans - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) diff --git a/test/decompiler/reference/levels/common/orb-cache_REF.gc b/test/decompiler/reference/levels/common/orb-cache_REF.gc index f60ac20a39..f6e8bfcae4 100644 --- a/test/decompiler/reference/levels/common/orb-cache_REF.gc +++ b/test/decompiler/reference/levels/common/orb-cache_REF.gc @@ -73,17 +73,16 @@ ) :trans (behavior () - (if (and - (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 2) - (set! (-> a1-1 message) 'query) - (set! (-> a1-1 param 0) (the-as uint 'powerup)) - (set! (-> a1-1 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-1)) - ) - ) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (let ((a1-1 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 2) + (set! (-> a1-1 message) 'query) + (set! (-> a1-1 param 0) (the-as uint 'powerup)) + (set! (-> a1-1 param 1) (the-as uint 3)) + (not (send-event-function *target* a1-1)) + ) + ) (level-hint-spawn (game-text-id sidekick-hint-orb-cache-top) "sksp0009" @@ -187,11 +186,10 @@ (set! f30-0 2048.0) (set! s3-0 #t) ) - (when (and - (< f30-0 15155.2) - (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (< (-> (target-pos 0) y) (-> obj basetrans y)) - ) + (when (and (< f30-0 15155.2) + (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) + (< (-> (target-pos 0) y) (-> obj basetrans y)) + ) (set! f30-0 (if (< 14131.2 f28-0) 15155.2 f28-0 @@ -239,7 +237,10 @@ :event (the-as (function process int symbol event-message-block object :behavior orb-cache-top) plat-event) :exit - (behavior () (process-entity-status! self (entity-perm-status bit-3) #f) (none)) + (behavior () + (process-entity-status! self (entity-perm-status bit-3) #f) + (none) + ) :trans (the-as (function none :behavior orb-cache-top) plat-trans) :code @@ -282,43 +283,40 @@ (suspend) ) (calculate-pos self #f) - (while (and - (not - (and - (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - (let ((a1-11 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-11 from) self) - (set! (-> a1-11 num-params) 2) - (set! (-> a1-11 message) 'query) - (set! (-> a1-11 param 0) (the-as uint 'powerup)) - (set! (-> a1-11 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-11) (-> self activated)) - ) - ) - ) - (not (pos-logic self #f)) - ) + (while (and (not + (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-11 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-11 from) self) + (set! (-> a1-11 num-params) 2) + (set! (-> a1-11 message) 'query) + (set! (-> a1-11 param 0) (the-as uint 'powerup)) + (set! (-> a1-11 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-11) (-> self activated)) + ) + ) + ) + (not (pos-logic self #f)) + ) (suspend) ) (if (not - (and - (and *target* (>= (-> self active-distance) - (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - (let ((a1-14 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-14 from) self) - (set! (-> a1-14 num-params) 2) - (set! (-> a1-14 message) 'query) - (set! (-> a1-14 param 0) (the-as uint 'powerup)) - (set! (-> a1-14 param 1) (the-as uint 3)) - (or (send-event-function *target* a1-14) (-> self activated)) - ) - ) - ) + (and (and *target* (>= (-> self active-distance) + (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (let ((a1-14 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-14 from) self) + (set! (-> a1-14 num-params) 2) + (set! (-> a1-14 message) 'query) + (set! (-> a1-14 param 0) (the-as uint 'powerup)) + (set! (-> a1-14 param 1) (the-as uint 3)) + (or (send-event-function *target* a1-14) (-> self activated)) + ) + ) + ) (go orb-cache-top-idle arg0) ) ) @@ -361,12 +359,12 @@ (defmethod init-from-entity! orb-cache-top ((obj orb-cache-top) (arg0 entity-actor)) (let ((a0-1 (-> obj entity))) (if (when a0-1 - (let ((a0-2 (-> a0-1 extra perm task))) - (if a0-2 - (= a0-2 (game-task none)) - ) - ) + (let ((a0-2 (-> a0-1 extra perm task))) + (if a0-2 + (= a0-2 (game-task none)) + ) ) + ) (set! (-> obj entity extra perm task) (game-task complete)) ) ) diff --git a/test/decompiler/reference/levels/common/plat-button_REF.gc b/test/decompiler/reference/levels/common/plat-button_REF.gc index 63e186746a..a1a8256a9f 100644 --- a/test/decompiler/reference/levels/common/plat-button_REF.gc +++ b/test/decompiler/reference/levels/common/plat-button_REF.gc @@ -79,18 +79,17 @@ (case arg2 (('touch) (when (can-activate? self) - (if (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self root-override) - (the-as uint 1) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self root-override) + (the-as uint 1) + ) + (or (not (-> self should-grab-player?)) (let ((v0-3 (process-grab? *target*))) + (set! (-> self grab-player?) v0-3) + v0-3 + ) + ) ) - (or (not (-> self should-grab-player?)) (let ((v0-3 (process-grab? *target*))) - (set! (-> self grab-player?) v0-3) - v0-3 - ) - ) - ) (go-virtual plat-button-pressed) ) ) @@ -274,14 +273,12 @@ ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1200) - (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1200) + (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-upward) @@ -356,14 +353,12 @@ ) (rider-trans) (when (-> self go-back-if-lost-player?) - (when (or (not *target*) (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1200) - (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (when (or (not *target*) (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1200) + (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) + ) ) (set! (-> self go-back-if-lost-player?) #f) (go-virtual plat-button-move-downward) @@ -417,8 +412,7 @@ (sound-stop (-> self sound-id)) (sound-play-by-name (static-sound-name "elev-land") (new-sound-id) 1024 0 0 1 #t) (while #t - (if (or - (not *target*) + (if (or (not *target*) (< 268435460.0 (vector-vector-xz-distance-squared (-> self root-override trans) (target-pos 0))) ) (go-virtual plat-button-idle) @@ -533,15 +527,15 @@ (set! (-> obj grab-player?) #f) (set! (-> obj should-grab-player?) #f) (set! (-> obj trans-off quad) (-> (the-as vector ((method-of-type res-lump get-property-struct) - arg0 - 'trans-offset - 'interp - -1000000000.0 - *null-vector* - (the-as (pointer res-tag) #f) - *res-static-buf* - ) - ) + arg0 + 'trans-offset + 'interp + -1000000000.0 + *null-vector* + (the-as (pointer res-tag) #f) + *res-static-buf* + ) + ) quad ) ) diff --git a/test/decompiler/reference/levels/common/plat_REF.gc b/test/decompiler/reference/levels/common/plat_REF.gc index ef436913f4..ce69d07249 100644 --- a/test/decompiler/reference/levels/common/plat_REF.gc +++ b/test/decompiler/reference/levels/common/plat_REF.gc @@ -127,33 +127,32 @@ (defmethod get-unlit-skel plat ((obj plat)) (cond ((= (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) + (-> obj entity extra level) + (-> *level* level-default) + ) + name + ) 'jungleb ) *plat-jungleb-sg* ) - ((or - (= (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) - 'sunken - ) - (= (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) - 'sunkenb - ) - ) + ((or (= (-> (if (-> obj entity) + (-> obj entity extra level) + (-> *level* level-default) + ) + name + ) + 'sunken + ) + (= (-> (if (-> obj entity) + (-> obj entity extra level) + (-> *level* level-default) + ) + name + ) + 'sunkenb + ) + ) *plat-sunken-sg* ) (else @@ -200,11 +199,11 @@ ;; INFO: Return type mismatch sparticle-launch-control vs sparticle-launch-group. (defmethod TODO-RENAME-25 plat ((obj plat)) (the-as sparticle-launch-group (when (!= (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) - name - ) + (-> obj entity extra level) + (-> *level* level-default) + ) + name + ) 'maincave ) (let ((v0-0 (create-launch-control (-> *part-group-id-table* 107) obj))) @@ -241,7 +240,10 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :trans - (behavior () (dummy-20 self) (none)) + (behavior () + (dummy-20 self) + (none) + ) :code (behavior () (plat-trans) @@ -271,7 +273,10 @@ :event (the-as (function process int symbol event-message-block object :behavior plat) plat-event) :exit - (behavior () (sound-stop (-> self sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (none) + ) :trans (behavior () (set! (-> self path-pos) (if (logtest? (-> self fact options) (fact-options fop3)) diff --git a/test/decompiler/reference/levels/common/rigid-body_REF.gc b/test/decompiler/reference/levels/common/rigid-body_REF.gc index 528d0a3da4..6230b7dbce 100644 --- a/test/decompiler/reference/levels/common/rigid-body_REF.gc +++ b/test/decompiler/reference/levels/common/rigid-body_REF.gc @@ -422,24 +422,24 @@ (let ((v1-0 (-> obj water-anim))) 0.0 (+ (the-as float (cond - (v1-0 - (let* ((a2-1 v1-0) - (a0-1 (if a2-1 - (-> a2-1 ppointer-water-anim 3) - ) - ) - ) - (if a0-1 - (get-ripple-height a0-1 arg0) - (-> v1-0 ppointer-water-anim 9) + (v1-0 + (let* ((a2-1 v1-0) + (a0-1 (if a2-1 + (-> a2-1 ppointer-water-anim 3) + ) + ) ) - ) - ) - (else - (ocean-get-height arg0) - ) - ) - ) + (if a0-1 + (get-ripple-height a0-1 arg0) + (-> v1-0 ppointer-water-anim 9) + ) + ) + ) + (else + (ocean-get-height arg0) + ) + ) + ) (-> obj float-height-offset) ) ) @@ -551,10 +551,9 @@ (set! (-> obj player-velocity quad) (-> *target* control transv quad)) (set! (-> obj player-velocity quad) (-> *null-vector* quad)) ) - (+! - (-> obj sim-time-remaining) - (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) - ) + (+! (-> obj sim-time-remaining) + (* 0.0033333334 (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)))) + ) (let ((f30-0 0.016666668) (f28-0 (* 0.0033333334 (the float (logand #xffffff (-> *display* base-frame-counter))))) ) @@ -721,9 +720,9 @@ :trans (behavior () (if (and *target* (>= (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) + ) (go-virtual rigid-body-platform-float) ) (none) @@ -747,9 +746,9 @@ :trans (behavior () (if (or (not *target*) (< (-> self info idle-distance) - (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans)) + ) + ) (go-virtual rigid-body-platform-idle) ) (none) diff --git a/test/decompiler/reference/levels/common/sharkey_REF.gc b/test/decompiler/reference/levels/common/sharkey_REF.gc index 19c4781e74..4b3cfcf66f 100644 --- a/test/decompiler/reference/levels/common/sharkey_REF.gc +++ b/test/decompiler/reference/levels/common/sharkey_REF.gc @@ -105,16 +105,14 @@ nav-enemy-default-event-handler ;; definition for method 12 of type sharkey (defmethod run-logic? sharkey ((obj sharkey)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) - (vector-vector-distance (-> obj collide-info trans) (math-camera-pos)) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj collide-info pause-adjust-distance)) + (vector-vector-distance (-> obj collide-info 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-status drwf04))) ) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status drwf04))) ) - ) ) ;; definition for method 40 of type sharkey @@ -198,19 +196,18 @@ nav-enemy-default-event-handler ;; definition for function sharkey-notice-player? (defbehavior sharkey-notice-player? sharkey () (if *target* - (and - (< (- (-> *target* control trans y) (-> self y-max)) 0.0) - (let ((gp-0 'racer) - (a1-0 (new 'stack-no-clear 'event-message-block)) - ) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (!= gp-0 (send-event-function *target* a1-0)) - ) - (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) - ) + (and (< (- (-> *target* control trans y) (-> self y-max)) 0.0) + (let ((gp-0 'racer) + (a1-0 (new 'stack-no-clear 'event-message-block)) + ) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'mode)) + (!= gp-0 (send-event-function *target* a1-0)) + ) + (nav-enemy-test-point-near-nav-mesh? (-> *target* control shadow-pos)) + ) ) ) @@ -284,18 +281,20 @@ nav-enemy-default-event-handler (none) ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :trans (behavior () (cond ((-> self enable-patrol) - (if (and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - ) + (if (and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + ) (go-virtual nav-enemy-patrol) ) ) @@ -305,13 +304,11 @@ nav-enemy-default-event-handler (set! (-> self notice-time) (-> *display* base-frame-counter)) ) (let ((a0-4 (dummy-16 (-> self nav) (-> *target* control trans)))) - (when (or - (and a0-4 (logtest? (-> a0-4 pat) 2)) - (and - (logtest? (-> self draw status) (draw-status drwf01)) - (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) + (when (or (and a0-4 (logtest? (-> a0-4 pat) 2)) + (and (logtest? (-> self draw status) (draw-status drwf01)) + (>= (- (-> *display* base-frame-counter) (-> self notice-time)) (-> self reaction-time)) + ) ) - ) (sharkey-move-to-attack-position) (set! (-> self player-in-water) #t) (go-virtual nav-enemy-chase) @@ -421,7 +418,10 @@ nav-enemy-default-event-handler (none) ) :post - (behavior () (nav-enemy-travel-post) (none)) + (behavior () + (nav-enemy-travel-post) + (none) + ) ) ;; failed to figure out what this is: @@ -433,9 +433,15 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) :code - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) ) ;; definition for function sharkey-follow-trajectory @@ -544,7 +550,10 @@ nav-enemy-default-event-handler (none) ) :post - (behavior () (nav-enemy-simple-post) (none)) + (behavior () + (nav-enemy-simple-post) + (none) + ) ) ;; failed to figure out what this is: @@ -556,7 +565,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (sound-stop (-> self sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (none) + ) :trans (behavior () (if (not *target*) @@ -587,10 +599,9 @@ nav-enemy-default-event-handler (cond ((-> self player-in-water) (set! (-> self free-time) (-> *display* base-frame-counter)) - (if (and - (< (fabs (- (-> gp-0 y) (-> self collide-info trans y))) 40960.0) - (< (vector-vector-xz-distance gp-0 (-> self collide-info trans)) 24576.0) - ) + (if (and (< (fabs (- (-> gp-0 y) (-> self collide-info trans y))) 40960.0) + (< (vector-vector-xz-distance gp-0 (-> self collide-info trans)) 24576.0) + ) (go-virtual nav-enemy-attack) ) ) diff --git a/test/decompiler/reference/levels/common/static-screen_REF.gc b/test/decompiler/reference/levels/common/static-screen_REF.gc index 7e55b92ee2..5580c25f82 100644 --- a/test/decompiler/reference/levels/common/static-screen_REF.gc +++ b/test/decompiler/reference/levels/common/static-screen_REF.gc @@ -142,7 +142,12 @@ (none) ) :trans - (behavior () (hide-hud-quick) (spawn (-> self part 0) *zero-vector*) 0 (none)) + (behavior () + (hide-hud-quick) + (spawn (-> self part 0) *zero-vector*) + 0 + (none) + ) :code (behavior ((arg0 int) (arg1 int) (arg2 symbol)) (local-vars (v1-6 symbol)) @@ -150,14 +155,12 @@ (until v1-6 (suspend) (set! v1-6 - (or - (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) arg1)) - (and - arg2 - (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) 300) - (cpad-pressed? 0 select start triangle circle x square) + (or (and (> arg1 0) (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) arg1)) + (and arg2 + (>= (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) 300) + (cpad-pressed? 0 select start triangle circle x square) + ) ) - ) ) ) (set! (-> *setting-control* default bg-a) 1.0) diff --git a/test/decompiler/reference/levels/common/water-anim_REF.gc b/test/decompiler/reference/levels/common/water-anim_REF.gc index c96d49cbe5..06bdb074d2 100644 --- a/test/decompiler/reference/levels/common/water-anim_REF.gc +++ b/test/decompiler/reference/levels/common/water-anim_REF.gc @@ -1007,9 +1007,9 @@ (let ((s4-0 (-> s5-1 skel-group value))) (let ((s3-0 s4-0)) (if (not (if (and (nonzero? s3-0) (type-type? (-> (the-as basic s3-0) type) skeleton-group)) - s3-0 - ) - ) + s3-0 + ) + ) (go process-drawable-art-error "skel group") ) ) diff --git a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc index f1933b56ea..4274f2a0c1 100644 --- a/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc +++ b/test/decompiler/reference/levels/darkcave/darkcave-obs_REF.gc @@ -117,12 +117,13 @@ ;; failed to figure out what this is: (defstate cavecrystal-idle (cavecrystal) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('attack) - (go cavecrystal-active) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('attack) + (go cavecrystal-active) + ) + ) + ) :trans (behavior () (if (and *target* (>= 40960.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) @@ -138,7 +139,12 @@ (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -219,7 +225,12 @@ (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; definition for method 10 of type cavecrystal diff --git a/test/decompiler/reference/levels/finalboss/final-door_REF.gc b/test/decompiler/reference/levels/finalboss/final-door_REF.gc index 3f121851af..c00ddb0f92 100644 --- a/test/decompiler/reference/levels/finalboss/final-door_REF.gc +++ b/test/decompiler/reference/levels/finalboss/final-door_REF.gc @@ -94,15 +94,22 @@ (defstate idle (final-door) :virtual #t :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('open) - enter-state - (go-virtual open) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('open) + enter-state + (go-virtual open) + ) + ) + ) :code - (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 (none)) + (behavior () + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -249,24 +256,21 @@ (behavior () (ja-post) (while #t - (if (and - (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and - (zero? (logand (-> *target* state-flags) 256)) - (and - (>= (-> *game-info* fuel) 100.0) - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) - (send-event - *target* - 'change-mode - 'final-door - (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-right))) - (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-left))) + (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (and (zero? (logand (-> *target* state-flags) 256)) + (and (>= (-> *game-info* fuel) 100.0) + (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (= (get-task-status (game-task finalboss-movies)) (task-status need-reward-speech)) + (send-event + *target* + 'change-mode + 'final-door + (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-right))) + (search-process-tree *active-pool* (lambda ((arg0 final-door)) (= (-> arg0 type) power-left))) + ) + ) ) - ) - ) - ) + ) (process-entity-status! self (entity-perm-status complete) #t) ) (suspend) @@ -446,7 +450,10 @@ (none) ) :trans - (behavior () (set-letterbox-frames 5) (none)) + (behavior () + (set-letterbox-frames 5) + (none) + ) :code (behavior ((arg0 basic) (arg1 handle)) (local-vars (sv-144 process) (sv-160 vector) (sv-176 process) (sv-192 vector)) diff --git a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc index 07ad546e96..7258e1c898 100644 --- a/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc +++ b/test/decompiler/reference/levels/finalboss/green-eco-lurker_REF.gc @@ -459,9 +459,15 @@ ;; failed to figure out what this is: (defstate green-eco-lurker-tune-spheres (green-eco-lurker) :trans - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :code - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :post (the-as (function none :behavior green-eco-lurker) transform-post) ) @@ -576,10 +582,9 @@ (go green-eco-lurker-appear-land) ) ) - (when (and - (not (-> self played-sound?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) - ) + (when (and (not (-> self played-sound?)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self sound-delay)) + ) (set! (-> self played-sound?) #t) (sound-play-by-name (static-sound-name "blob-jump") @@ -739,8 +744,8 @@ (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 8) ) (let ((a0-5 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/finalboss/light-eco_REF.gc b/test/decompiler/reference/levels/finalboss/light-eco_REF.gc index 5244c4bf9a..d19f93d6e1 100644 --- a/test/decompiler/reference/levels/finalboss/light-eco_REF.gc +++ b/test/decompiler/reference/levels/finalboss/light-eco_REF.gc @@ -534,7 +534,10 @@ :event light-eco-child-default-event-handler :enter - (behavior () (set! (-> self falling-start-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self falling-start-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (let ((f30-0 @@ -569,7 +572,10 @@ :event light-eco-child-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (let ((f30-0 (+ (-> self root-override transv y) (* -544768.0 (-> *display* seconds-per-frame))))) @@ -624,7 +630,10 @@ :event light-eco-child-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 1200) @@ -666,7 +675,11 @@ ;; failed to figure out what this is: (defstate light-eco-child-grabbed (light-eco-child) :code - (behavior () (suspend) 0 (none)) + (behavior () + (suspend) + 0 + (none) + ) ) ;; definition for function light-eco-child-init-by-other @@ -850,7 +863,11 @@ :event light-eco-mother-default-event-handler :trans - (behavior () (common-trans self) (spawn (-> self part2) (-> self root trans)) (none)) + (behavior () + (common-trans self) + (spawn (-> self part2) (-> self root trans)) + (none) + ) :code (behavior () (while (!= (-> self root scale x) 12.0) @@ -875,7 +892,12 @@ :event light-eco-mother-default-event-handler :trans - (behavior () (common-trans self) (spawn (-> self part) (-> self root trans)) 0 (none)) + (behavior () + (common-trans self) + (spawn (-> self part) (-> self root trans)) + 0 + (none) + ) :code (behavior () (while #t @@ -896,7 +918,10 @@ :event light-eco-mother-default-event-handler :trans - (behavior () (common-trans self) (none)) + (behavior () + (common-trans self) + (none) + ) :code (behavior () (while (!= (-> self root scale x) 0.0) @@ -996,7 +1021,3 @@ (go light-eco-mother-appear) (none) ) - - - - diff --git a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc index ffecc1e37d..b5bc133964 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-misc_REF.gc @@ -293,12 +293,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc index 11d5b66083..abd60403a5 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss-weapon_REF.gc @@ -49,11 +49,10 @@ (when (and (logtest? (-> s4-0 prim-core collide-as) 16) (TODO-RENAME-10 obj (-> s4-0 prim-core) arg0)) (countdown (s3-0 (-> s4-0 num-prims)) (let ((v1-9 (-> s4-0 prims s3-0))) - (if (and - (logtest? (-> v1-9 prim-core action) 1) - (logtest? (-> v1-9 prim-core collide-as) 16) - (TODO-RENAME-10 obj (-> v1-9 prim-core) arg0) - ) + (if (and (logtest? (-> v1-9 prim-core action) 1) + (logtest? (-> v1-9 prim-core collide-as) 16) + (TODO-RENAME-10 obj (-> v1-9 prim-core) arg0) + ) (return #t) ) ) @@ -241,7 +240,11 @@ ;; failed to figure out what this is: (defstate arcing-shot-debug-trajectory (arcing-shot) :trans - (behavior () (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) (arcing-shot-draw) (none)) + (behavior () + (arcing-shot-setup (camera-pos) (-> self entity extra trans) 40960.0) + (arcing-shot-draw) + (none) + ) :code (behavior () (while #t @@ -382,7 +385,10 @@ (none) ) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) @@ -425,8 +431,8 @@ (go darkecobomb-explode #f) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) (let ((gp-2 (new 'stack-no-clear 'vector))) @@ -487,7 +493,11 @@ :event darkecobomb-handler :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) 0 (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + 0 + (none) + ) :trans (behavior () (darkecobomb-explode-if-player-high-enough) @@ -535,7 +545,10 @@ ;; failed to figure out what this is: (defstate darkecobomb-idle (darkecobomb) :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + (none) + ) :trans (behavior () (arcing-shot-calculate @@ -670,7 +683,10 @@ ;; failed to figure out what this is: (defstate greenshot-idle (greenshot) :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + (none) + ) :trans (behavior () (arcing-shot-calculate @@ -692,12 +708,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -955,7 +971,10 @@ :event redshot-handler :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + (none) + ) :trans (behavior () (redshot-trans (- (-> self stall-time) (- (-> *display* game-frame-counter) (-> self state-time)))) @@ -981,7 +1000,10 @@ :event redshot-handler :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + (none) + ) :trans (behavior () (redshot-trans 1500) @@ -1101,7 +1123,10 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* game-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* game-frame-counter)) + (none) + ) :trans (behavior () (arcing-shot-calculate diff --git a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc index 6b206405d1..1b2ad88e9d 100644 --- a/test/decompiler/reference/levels/finalboss/robotboss_REF.gc +++ b/test/decompiler/reference/levels/finalboss/robotboss_REF.gc @@ -50,25 +50,22 @@ (defbehavior robotboss-cut-cam robotboss ((arg0 float) (arg1 float) (arg2 int)) (let ((f0-0 (ja-aframe-num 0))) (cond - ((or - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - arg2 - ) - ) - (< f0-0 arg0) - (< arg1 f0-0) - ) + ((or (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + arg2 + ) + ) + (< f0-0 arg0) + (< arg1 f0-0) + ) (robotboss-cut-cam-exit) ) - ((or - (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) + ((or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + (-> self skip-cut) ) - (-> self skip-cut) - ) (set! (-> self skip-cut) #t) ) (else @@ -495,12 +492,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -542,12 +539,12 @@ ) ) (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -583,12 +580,12 @@ ) ) (set! (-> a0-25 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -624,12 +621,12 @@ ) ) (set! (-> a0-34 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -664,8 +661,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 30) ) ) @@ -680,12 +677,12 @@ ) ) (set! (-> a0-48 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -757,7 +754,10 @@ (none) ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :trans (behavior () (spool-push *art-control* "green-sagecage-daxter-sacrifice" 0 self (the-as float -1.0)) @@ -995,12 +995,12 @@ ) ) (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1024,8 +1024,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 30) ) ) @@ -1041,12 +1041,12 @@ ) ) (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1120,18 +1120,17 @@ ;; definition for function robotboss-is-yellow-hit (defbehavior robotboss-is-yellow-hit robotboss () - (or - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) + (or (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 28) + ) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 35) + ) + ) ) ;; definition for function robotboss-time-to-shoot-yellow @@ -1328,13 +1327,13 @@ ) ((and (> (-> self hits-to-go) 0) (-> self took-hit)) (if (not - ((method-of-type ambient-control play-ambient) - (the-as ambient-control (&-> self ambient)) - "GOL-AM17" - #t - (the-as vector #f) - ) - ) + ((method-of-type ambient-control play-ambient) + (the-as ambient-control (&-> self ambient)) + "GOL-AM17" + #t + (the-as vector #f) + ) + ) ((method-of-type ambient-control play-ambient) (the-as ambient-control (&-> self ambient)) "MAI-AM06" @@ -1351,10 +1350,9 @@ ) (robotboss-position) (robotboss-cut-cam (the-as float 5.0) (the-as float 50.0) (the-as int (-> self draw art-group data 29))) - (when (and - (-> self keep-charging) - (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - ) + (when (and (-> self keep-charging) + (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + ) (let ((gp-2 (new 'stack-no-clear 'vector))) (update! (-> self looping-sound 3)) (vector<-cspace! gp-2 (-> self node-list data 21)) @@ -1381,8 +1379,8 @@ (while #t (when (not (robotboss-time-to-shoot-yellow)) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 26) ) ) @@ -1397,18 +1395,17 @@ (set! (-> v1-30 frame-num) 15.0) ) ) - (while (not (or - (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) - ) - ) + (while (not (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 35) + ) + ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 26) ) ) @@ -1423,12 +1420,12 @@ ) ) (set! (-> a0-24 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1458,8 +1455,8 @@ (label cfg-36) (when (not (robotboss-is-yellow-hit)) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 26) ) ) @@ -1474,12 +1471,12 @@ ) ) (set! (-> a0-41 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1511,21 +1508,20 @@ ) ) (label cfg-55) - (when (and - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 35) + (when (and (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 35) + ) ) - ) - (or (robotboss-time-to-shoot-yellow) (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 28) + (or (robotboss-time-to-shoot-yellow) (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 28) + ) ) - ) - ) - ) + ) + ) (set! (-> self state-time) (-> *display* game-frame-counter)) (let* ((f30-1 (-> self dda yellow-shot-time-min)) (f28-0 (-> self dda yellow-shot-time-rnd)) @@ -1605,12 +1601,12 @@ ) ) (set! (-> a0-70 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1634,8 +1630,8 @@ ) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 35) ) (let ((a0-77 (-> self skel root-channel 0))) @@ -1716,12 +1712,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1748,8 +1744,8 @@ (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 23) ) ) @@ -1760,8 +1756,8 @@ ) ) ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 21) ) ) @@ -1777,12 +1773,12 @@ ) ) (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1832,10 +1828,9 @@ :trans (behavior () (robotboss-always-trans robotboss-yellow) - (if (and - (< (-> self children-spawned) 0) - (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) - ) + (if (and (< (-> self children-spawned) 0) + (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) + ) (go robotboss-yellow) ) (robotboss-position) @@ -1862,12 +1857,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1896,8 +1891,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 21) ) ) @@ -1912,12 +1907,12 @@ ) ) (set! (-> a0-19 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1980,12 +1975,12 @@ ) ) (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2009,8 +2004,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 21) ) ) @@ -2026,12 +2021,12 @@ ) ) (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2232,18 +2227,17 @@ ;; definition for function robotboss-is-red-hit (defbehavior robotboss-is-red-hit robotboss () - (or - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 19) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) + (or (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 19) + ) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) + ) + ) ) ;; failed to figure out what this is: @@ -2453,13 +2447,13 @@ ) ((and (> (-> self hits-to-go) 0) (-> self took-hit)) (if (not - ((method-of-type ambient-control play-ambient) - (the-as ambient-control (&-> self ambient)) - "GOL-AM17" - #t - (the-as vector #f) - ) - ) + ((method-of-type ambient-control play-ambient) + (the-as ambient-control (&-> self ambient)) + "GOL-AM17" + #t + (the-as vector #f) + ) + ) ((method-of-type ambient-control play-ambient) (the-as ambient-control (&-> self ambient)) "MAI-AM06" @@ -2490,14 +2484,13 @@ ) (robotboss-setup-for-hits 1 5) (while #t - (until (or - (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) - ) + (until (or (>= (- (-> *display* game-frame-counter) (-> self state-time)) (-> self till-next-shot)) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) + ) + ) (ja-channel-push! 1 60) (let ((v1-11 (-> self skel root-channel 0))) (set! (-> v1-11 frame-group) (the-as art-joint-anim (-> self draw art-group data 16))) @@ -2508,12 +2501,12 @@ ) ) (set! (-> a0-7 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2530,10 +2523,10 @@ ) (until (ja-done? 0) (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 34) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 34) + ) (goto cfg-24) ) (suspend) @@ -2566,12 +2559,12 @@ ) ) (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2606,8 +2599,8 @@ (stop! (-> self looping-sound 2)) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 34) ) ) @@ -2695,12 +2688,12 @@ ) ) (set! (-> a0-56 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2724,8 +2717,8 @@ ) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 34) ) (let ((a0-63 (-> self skel root-channel 0))) @@ -2799,12 +2792,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2829,8 +2822,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -2845,12 +2838,12 @@ ) ) (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2885,16 +2878,23 @@ :event robotboss-bomb-handler :enter - (behavior () (set! (-> self children-spawned) 0) 0 (none)) + (behavior () + (set! (-> self children-spawned) 0) + 0 + (none) + ) :exit - (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none)) + (behavior () + (set! (-> self ignore-camera) #f) + (set! (-> self des-cam-entity) #f) + (none) + ) :trans (behavior () (robotboss-always-trans robotboss-red) - (if (and - (< (-> self children-spawned) 0) - (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) - ) + (if (and (< (-> self children-spawned) 0) + (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) + ) (go robotboss-red) ) (robotboss-position) @@ -2921,12 +2921,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2961,8 +2961,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -2977,12 +2977,12 @@ ) ) (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3051,12 +3051,12 @@ ) ) (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3080,8 +3080,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -3097,12 +3097,12 @@ ) ) (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3446,15 +3446,15 @@ (while #t (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 13) ) (go robotboss-green-dark-bomb) ) ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -3470,12 +3470,12 @@ ) ) (set! (-> a0-14 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3556,12 +3556,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3586,8 +3586,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -3602,12 +3602,12 @@ ) ) (set! (-> a0-17 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3642,16 +3642,23 @@ :event robotboss-bomb-handler :enter - (behavior () (set! (-> self children-spawned) 0) 0 (none)) + (behavior () + (set! (-> self children-spawned) 0) + 0 + (none) + ) :exit - (behavior () (set! (-> self ignore-camera) #f) (set! (-> self des-cam-entity) #f) (none)) + (behavior () + (set! (-> self ignore-camera) #f) + (set! (-> self des-cam-entity) #f) + (none) + ) :trans (behavior () (robotboss-always-trans robotboss-green) - (if (and - (< (-> self children-spawned) 0) - (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) - ) + (if (and (< (-> self children-spawned) 0) + (or (not *target*) (!= (-> *target* control unknown-surface00 name) 'launch-jump)) + ) (go robotboss-green) ) (robotboss-position) @@ -3678,12 +3685,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3720,8 +3727,8 @@ (cond ((and *target* (< (+ 81920.0 (-> self entity extra trans y)) (-> (target-pos 0) y))) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) ) @@ -3732,8 +3739,8 @@ ) ) ((not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -3749,12 +3756,12 @@ ) ) (set! (-> a0-30 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3817,12 +3824,12 @@ ) ) (set! (-> a0-4 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3846,8 +3853,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -3863,12 +3870,12 @@ ) ) (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -3921,14 +3928,13 @@ ) ) (cond - ((and - (>= (- (-> *display* game-frame-counter) (-> self state-time)) 120) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) + ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) 120) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) ) - ) (spawn (-> self particle 0) s4-0) (when (and arg1 (nonzero? (-> self looping-sound 0))) (update! (-> self looping-sound 0)) @@ -3960,23 +3966,21 @@ ) ) (cond - ((and - (>= (- (-> *display* game-frame-counter) (-> self state-time)) 420) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) + ((and (>= (- (-> *display* game-frame-counter) (-> self state-time)) 420) + (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) ) - ) - ) + ) (spawn (-> self particle 1) gp-0) (when (and arg1 (nonzero? (-> self looping-sound 1))) (update! (-> self looping-sound 1)) - (when (and - *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) - ) + (when (and *target* + (zero? (logand (-> *target* state-flags) #x80f8)) + (>= 8192.0 (vector-vector-distance gp-0 (target-pos 0))) + ) (let ((a1-16 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-16 from) self) (set! (-> a1-16 num-params) 2) @@ -4230,13 +4234,13 @@ ) ((-> self took-hit) (if (not - ((method-of-type ambient-control play-ambient) - (the-as ambient-control (&-> self ambient)) - "GOL-AM17" - #t - (the-as vector #f) - ) - ) + ((method-of-type ambient-control play-ambient) + (the-as ambient-control (&-> self ambient)) + "GOL-AM17" + #t + (the-as vector #f) + ) + ) ((method-of-type ambient-control play-ambient) (the-as ambient-control (&-> self ambient)) "MAI-AM06" @@ -4251,18 +4255,17 @@ ) ) ) - (when (not (or - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 33) - ) - ) + (when (not (or (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) + (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 33) + ) + ) ) ) (robotboss-blue-beam 8 #t) @@ -4348,8 +4351,8 @@ ) (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 3) ) ) @@ -4364,12 +4367,12 @@ ) ) (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -4419,12 +4422,12 @@ ) ) (set! (-> a0-20 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/finalboss/sage-finalboss-FIN_REF.gc b/test/decompiler/reference/levels/finalboss/sage-finalboss-FIN_REF.gc index 439955b838..70c55e7851 100644 --- a/test/decompiler/reference/levels/finalboss/sage-finalboss-FIN_REF.gc +++ b/test/decompiler/reference/levels/finalboss/sage-finalboss-FIN_REF.gc @@ -770,7 +770,11 @@ ) ) :enter - (behavior () (set! (-> self credit-fade) 0.0) ((-> (method-of-type process-taskable play-anim) enter)) (none)) + (behavior () + (set! (-> self credit-fade) 0.0) + ((-> (method-of-type process-taskable play-anim) enter)) + (none) + ) :exit (behavior () (when (= (current-status (-> self tasks)) (task-status invalid)) @@ -1181,16 +1185,28 @@ (none) ) :trans - (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable hidden) trans)) (none)) + (behavior () + (sage-finalboss-extra-trans) + ((-> (method-of-type process-taskable hidden) trans)) + (none) + ) ) ;; failed to figure out what this is: (defstate idle (sage-finalboss) :virtual #t :enter - (behavior () (sage-finalboss-extra-enter) ((-> (method-of-type process-taskable idle) enter)) (none)) + (behavior () + (sage-finalboss-extra-enter) + ((-> (method-of-type process-taskable idle) enter)) + (none) + ) :trans - (behavior () (sage-finalboss-extra-trans) ((-> (method-of-type process-taskable idle) trans)) (none)) + (behavior () + (sage-finalboss-extra-trans) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) ) ;; definition for method 11 of type sage-finalboss diff --git a/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc b/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc index 809fe6f479..62abf1aa36 100644 --- a/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/assistant-firecanyon_REF.gc @@ -84,32 +84,29 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) - (when (and - (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - #t + (when (and (cond + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + #t + ) + (else + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) + ) + (and (not (closed? (-> self tasks) (game-task firecanyon-assistant) (task-status need-reward-speech))) + (not (movie?)) + (not (level-hint-displayed?)) + (not (and *cheat-mode* (cpad-hold? 0 l3))) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) + ) ) - (else - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) - (and - (not (closed? (-> self tasks) (game-task firecanyon-assistant) (task-status need-reward-speech))) - (not (movie?)) - (not (level-hint-displayed?)) - (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) - ) - ) (hide-hud) (kill-current-level-hint '() '(sidekick voicebox) 'exit) - (when (and - (seen-text? *game-info* (game-text-id firecanyon-not-enough-cells)) - (hud-hidden?) - (can-grab-display? self) - (not (-> *setting-control* current hint)) - ) + (when (and (seen-text? *game-info* (game-text-id firecanyon-not-enough-cells)) + (hud-hidden?) + (can-grab-display? self) + (not (-> *setting-control* current hint)) + ) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -145,10 +142,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t @@ -173,12 +170,12 @@ ) ) (set! (-> a0-15 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -243,12 +240,12 @@ ) ) (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -304,12 +301,12 @@ ) ) (set! (-> a0-39 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -354,12 +351,12 @@ ) ) (set! (-> a0-49 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -424,12 +421,12 @@ ) ) (set! (-> a0-62 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -490,12 +487,12 @@ ) ) (set! (-> a0-75 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc index 55cd07459f..9b4c2b8ce3 100644 --- a/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc +++ b/test/decompiler/reference/levels/firecanyon/firecanyon-obs_REF.gc @@ -159,12 +159,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -265,18 +265,18 @@ (while (< s5-0 (+ (-> self num-alts) -1)) (let ((v1-2 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) (if (and v1-2 (-> v1-2 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-2 - (-> v1-2 extra process) - ) - a1-1 - ) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'go-spike-up) + (not (send-event-function + (if v1-2 + (-> v1-2 extra process) + ) + a1-1 ) - ) - ) + ) + ) + ) (set! gp-0 #f) ) ) @@ -298,12 +298,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -355,18 +355,18 @@ (while (< s5-0 (/ (-> self num-alts) 2)) (let ((v1-1 (entity-actor-lookup (-> self entity) 'alt-actor s5-0))) (if (and v1-1 (-> v1-1 extra process) (let ((a1-1 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-1 from) self) - (set! (-> a1-1 num-params) 0) - (set! (-> a1-1 message) 'go-spike-up) - (not (send-event-function - (if v1-1 - (-> v1-1 extra process) - ) - a1-1 - ) + (set! (-> a1-1 from) self) + (set! (-> a1-1 num-params) 0) + (set! (-> a1-1 message) 'go-spike-up) + (not (send-event-function + (if v1-1 + (-> v1-1 extra process) + ) + a1-1 ) - ) - ) + ) + ) + ) (set! gp-0 #f) ) ) @@ -394,17 +394,16 @@ (defstate spike-idle (spike) :trans (behavior () - (when (and - *target* - (let ((a1-0 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-0 from) self) - (set! (-> a1-0 num-params) 1) - (set! (-> a1-0 message) 'query) - (set! (-> a1-0 param 0) (the-as uint 'mode)) - (= (send-event-function *target* a1-0) 'racer) - ) - (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) - ) + (when (and *target* + (let ((a1-0 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-0 from) self) + (set! (-> a1-0 num-params) 1) + (set! (-> a1-0 message) 'query) + (set! (-> a1-0 param 0) (the-as uint 'mode)) + (= (send-event-function *target* a1-0) 'racer) + ) + (< (vector-vector-distance (-> self root-override trans) (target-pos 0)) 225280.0) + ) (sound-play-by-name (static-sound-name "magma-rock") (new-sound-id) 1024 0 0 1 #t) (let ((v1-8 (entity-actor-count (-> self entity) 'alt-actor))) 0 @@ -809,7 +808,13 @@ ) ) :code - (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 (none)) + (behavior () + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) ) ;; definition for method 11 of type crate-darkeco-cluster diff --git a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc index feb641d9d5..58c028928d 100644 --- a/test/decompiler/reference/levels/flut_common/flutflut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/flutflut_REF.gc @@ -132,14 +132,11 @@ (let ((v1-0 (-> self condition))) (cond ((or (zero? v1-0) (= v1-0 1)) - (if (or - (and - (task-complete? *game-info* (game-task beach-flutflut)) - (or - (and (zero? (-> self condition)) (task-closed? (game-task village2-levitator) (task-status need-hint))) - (and (= (-> self condition) 1) (task-closed? (game-task village3-button) (task-status need-hint))) - ) - ) + (if (or (and (task-complete? *game-info* (game-task beach-flutflut)) + (or (and (zero? (-> self condition)) (task-closed? (game-task village2-levitator) (task-status need-hint))) + (and (= (-> self condition) 1) (task-closed? (game-task village3-button) (task-status need-hint))) + ) + ) (and *cheat-mode* (cpad-hold? 0 l3)) (and *target* (logtest? (-> *target* control root-prim prim-core action) #x4000)) ) @@ -162,11 +159,10 @@ (if (= (-> self condition) 3) (goto cfg-75) ) - (if (and - *target* - (logtest? (-> *target* control root-prim prim-core action) #x4000) - (< (- (-> *display* base-frame-counter) (the-as int (-> self touch-time))) 15) - ) + (if (and *target* + (logtest? (-> *target* control root-prim prim-core action) #x4000) + (< (- (-> *display* base-frame-counter) (the-as int (-> self touch-time))) 15) + ) (go-virtual pickup (method-of-object self idle)) ) ) @@ -239,12 +235,11 @@ ) ) ) - (when (and - (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (not (movie?)) - (not (level-hint-displayed?)) - (!= (-> self condition) 4) - ) + (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (not (movie?)) + (not (level-hint-displayed?)) + (!= (-> self condition) 4) + ) (hide-hud) (level-hint-surpress!) (kill-current-level-hint '() '(sidekick voicebox) 'exit) @@ -304,14 +299,16 @@ ) ) :enter - (behavior ((arg0 (state flutflut))) ((-> arg0 enter)) (none)) + (behavior ((arg0 (state flutflut))) + ((-> arg0 enter)) + (none) + ) :code (behavior ((arg0 (state flutflut))) (ja-channel-set! 0) (ja-post) (while (zero? (ja-group-size)) - (if (or - (not *target*) + (if (or (not *target*) (< 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) (go arg0) diff --git a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc index 7dc6c74203..48de52d666 100644 --- a/test/decompiler/reference/levels/flut_common/target-flut_REF.gc +++ b/test/decompiler/reference/levels/flut_common/target-flut_REF.gc @@ -234,8 +234,8 @@ (defbehavior target-flut-hit-ground-anim target () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 144) ) (if (!= (-> self skel root-channel 0) (-> self skel channel)) @@ -282,8 +282,8 @@ #f ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 149) ) (ja-channel-set! 1) @@ -423,10 +423,10 @@ (case arg2 (('touched) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self control) - (the-as uint 224) - ) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 224) + ) (target-send-attack arg0 (the-as uint (-> self control unknown-symbol30)) @@ -459,24 +459,23 @@ :exit (behavior () (when (not - (or - (= (-> self next-state name) 'target-flut-stance) - (= (-> self next-state name) 'target-flut-walk) - (= (-> self next-state name) 'target-flut-jump) - (= (-> self next-state name) 'target-flut-double-jump) - (= (-> self next-state name) 'target-flut-hit-ground) - (= (-> self next-state name) 'target-flut-falling) - (= (-> self next-state name) 'target-flut-running-attack) - (= (-> self next-state name) 'target-flut-air-attack) - (= (-> self next-state name) 'target-flut-air-attack-hit-ground) - (= (-> self next-state name) 'target-flut-hit) - (= (-> self next-state name) 'target-flut-death) - (= (-> self next-state name) 'target-flut-get-on) - (= (-> self next-state name) 'target-flut-get-off) - (= (-> self next-state name) 'target-flut-get-off-jump) - (= (-> self next-state name) 'target-flut-grab) - (= (-> self next-state name) 'target-flut-clone-anim) - ) + (or (= (-> self next-state name) 'target-flut-stance) + (= (-> self next-state name) 'target-flut-walk) + (= (-> self next-state name) 'target-flut-jump) + (= (-> self next-state name) 'target-flut-double-jump) + (= (-> self next-state name) 'target-flut-hit-ground) + (= (-> self next-state name) 'target-flut-falling) + (= (-> self next-state name) 'target-flut-running-attack) + (= (-> self next-state name) 'target-flut-air-attack) + (= (-> self next-state name) 'target-flut-air-attack-hit-ground) + (= (-> self next-state name) 'target-flut-hit) + (= (-> self next-state name) 'target-flut-death) + (= (-> self next-state name) 'target-flut-get-on) + (= (-> self next-state name) 'target-flut-get-off) + (= (-> self next-state name) 'target-flut-get-off-jump) + (= (-> self next-state name) 'target-flut-grab) + (= (-> self next-state name) 'target-flut-clone-anim) + ) ) (let ((v1-33 (-> self manipy))) (when v1-33 @@ -612,7 +611,10 @@ :event target-flut-standard-event-handler :enter - (behavior () (set! (-> self control unknown-surface00) *flut-walk-mods*) (none)) + (behavior () + (set! (-> self control unknown-surface00) *flut-walk-mods*) + (none) + ) :exit (-> target-flut-start exit) :trans @@ -620,46 +622,38 @@ (if (move-legs?) (go target-flut-walk) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) ) (if (can-hands? #t) (go target-flut-running-attack) ) - (when (and - (zero? (logand (-> self control status) 1)) - (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (when (and (zero? (logand (-> self control status) 1)) + (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) ) - ) + (< 4096.0 (target-height-above-ground)) + ) + ) ) - (or - (not (or - (= v1-37 (-> self draw art-group data 59)) - (= v1-37 (-> self draw art-group data 60)) - (= v1-37 (-> self draw art-group data 61)) - ) - ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) - ) + ) enter-state (go target-flut-falling) ) @@ -678,8 +672,8 @@ (set! gp-0 60) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 155) ) (let ((a0-11 (-> self skel root-channel 0))) @@ -693,8 +687,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 158) ) (let ((a0-17 (-> self skel root-channel 0))) @@ -716,8 +710,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 150) ) (let ((a0-24 (-> self skel root-channel 0))) @@ -741,11 +735,11 @@ ) ) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 140) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 140) + ) + ) (ja-channel-push! 1 gp-0) ) ) @@ -789,46 +783,38 @@ (if (not (move-legs?)) (go target-flut-stance) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) ) (if (can-hands? #t) (go target-flut-running-attack) ) - (when (and - (zero? (logand (-> self control status) 1)) - (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-37 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (when (and (zero? (logand (-> self control status) 1)) + (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-37 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-37 (-> self draw art-group data 59)) + (= v1-37 (-> self draw art-group data 60)) + (= v1-37 (-> self draw art-group data 61)) + ) ) - ) + (< 4096.0 (target-height-above-ground)) + ) + ) ) - (or - (not (or - (= v1-37 (-> self draw art-group data 59)) - (= v1-37 (-> self draw art-group data 60)) - (= v1-37 (-> self draw art-group data 61)) - ) - ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) - ) + ) enter-state (go target-flut-falling) ) @@ -866,8 +852,8 @@ (let ((gp-0 22)) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 140) ) (set! gp-0 60) @@ -877,12 +863,11 @@ ) ) ) - (or - (= v1-9 (-> self draw art-group data 143)) - (= v1-9 (-> self draw art-group data 144)) - (= v1-9 (-> self draw art-group data 152)) - (= v1-9 (-> self draw art-group data 154)) - ) + (or (= v1-9 (-> self draw art-group data 143)) + (= v1-9 (-> self draw art-group data 144)) + (= v1-9 (-> self draw art-group data 152)) + (= v1-9 (-> self draw art-group data 154)) + ) ) (ja-channel-push! 1 24) (let ((a0-18 (-> self skel root-channel 0))) @@ -906,16 +891,16 @@ ) (set! f30-0 (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 161) ) (ja-channel-set! 2) 1.0 ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 141) ) (set! f28-0 (ja-frame-num 0)) @@ -996,20 +981,19 @@ (defstate target-flut-jump (target) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (when (and - (= arg2 'touched) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self control) - (the-as uint 6) - ) - (< 0.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) - ) + (when (and (= arg2 'touched) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 6) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) ) - ) (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) (when (target-send-attack arg0 @@ -1045,7 +1029,11 @@ (none) ) :exit - (behavior () (target-exit) ((-> target-flut-start exit)) (none)) + (behavior () + (target-exit) + ((-> target-flut-start exit)) + (none) + ) :trans (behavior () (set! (-> self control unknown-float123) @@ -1057,46 +1045,38 @@ (if (logtest? (-> self control status) 1) (go target-flut-hit-ground) ) - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) - (and - (zero? (logand (-> self water flags) 512)) - (zero? (logand (-> self state-flags) 2048)) - (< 4096.0 (target-height-above-ground)) - ) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) (pad-buttons x)) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 40960.0) + (and (zero? (logand (-> self water flags) 512)) + (zero? (logand (-> self state-flags) 2048)) + (< 4096.0 (target-height-above-ground)) + ) + ) (go target-flut-double-jump (-> *FLUT-bank* double-jump-height-min) (-> *FLUT-bank* double-jump-height-max)) ) - (if (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons square) - ) - (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) - (and - (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons square) + ) + (< (vector-dot (-> self control dynam gravity-normal) (-> self control transv)) 61440.0) + (and (< -61440.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) ) - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - ) - ) + ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) - (when (if (and - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - (not - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (when (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (not + (and *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) ) - ) - ) - ) + ) #t ) (logior! (-> self control status) 1) @@ -1254,26 +1234,21 @@ (if (logtest? (-> self control status) 1) (go target-flut-hit-ground) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons square) + ) + (and (zero? (logand (-> self state-flags) 4096)) + (zero? (logand (-> self control unknown-surface01 flags) 384)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) + (the-as int (-> *TARGET-bank* stuck-timeout)) + ) + (< 4096.0 (target-height-above-ground)) ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons square) - ) - (and - (zero? (logand (-> self state-flags) 4096)) - (zero? (logand (-> self control unknown-surface01 flags) 384)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword36)) - (the-as int (-> *TARGET-bank* stuck-timeout)) - ) - (< 4096.0 (target-height-above-ground)) - ) - ) + ) (go target-flut-air-attack (-> *FLUT-bank* air-attack-speed)) ) (if (!= (-> self state-time) (-> *display* base-frame-counter)) @@ -1285,10 +1260,10 @@ ) ) (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 149) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 149) + ) (sound-play-by-name (static-sound-name "flut-flap") (-> self flut flap-sound-id) 1024 0 0 1 #t) ) (set! (-> self control unknown-float122) @@ -1434,46 +1409,38 @@ (-> target-flut-start exit) :trans (behavior () - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-flut-jump (-> *FLUT-bank* jump-height-min) (-> *FLUT-bank* jump-height-max)) ) (if (move-legs?) (go target-flut-walk) ) - (when (and - (zero? (logand (-> self control status) 1)) - (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-34 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (when (and (zero? (logand (-> self control status) 1)) + (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-34 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-34 (-> self draw art-group data 59)) + (= v1-34 (-> self draw art-group data 60)) + (= v1-34 (-> self draw art-group data 61)) + ) ) - ) + (< 4096.0 (target-height-above-ground)) + ) + ) ) - (or - (not (or - (= v1-34 (-> self draw art-group data 59)) - (= v1-34 (-> self draw art-group data 60)) - (= v1-34 (-> self draw art-group data 61)) - ) - ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) - ) + ) enter-state (go target-flut-falling) ) @@ -1505,25 +1472,21 @@ (-> target-flut-start exit) :trans (behavior () - (when (or - (logtest? (-> self control status) 1) - (if (and - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) - (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) - ) - (not - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ) - #t - ) - ) + (when (or (logtest? (-> self control status) 1) + (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) (-> *TARGET-bank* stuck-distance)) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) + (/ (the-as int (-> *TARGET-bank* stuck-time)) 2) + ) + (not + (and *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) + ) + ) + #t + ) + ) (logior! (-> self control status) 1) (go target-flut-hit-ground) ) @@ -1540,14 +1503,14 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 144) ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 149) ) (ja-channel-push! 2 60) @@ -1601,15 +1564,14 @@ (-> self control) (the-as uint 224) ) - (let ((gp-1 - (target-send-attack - arg0 - (the-as uint (-> self control unknown-symbol30)) - (-> arg3 param 0) - (-> self control unknown-dword50) - (-> self control unknown-dword51) - ) - ) + (let ((gp-1 (target-send-attack + arg0 + (the-as uint (-> self control unknown-symbol30)) + (-> arg3 param 0) + (-> self control unknown-dword50) + (-> self control unknown-dword51) + ) + ) ) (when gp-1 (set! (-> self control unknown-uint20) (the-as uint (-> *display* base-frame-counter))) @@ -1625,13 +1587,10 @@ ) ) ) - (if (and - v1-11 - (or - (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core collide-as) 256) - (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core action) 1024) - ) - ) + (if (and v1-11 (or (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core collide-as) 256) + (logtest? (-> (the-as collide-shape v1-11) root-prim prim-core action) 1024) + ) + ) (set! (-> self control unknown-uint31) (the-as uint 1)) ) ) @@ -1667,10 +1626,9 @@ (set! (-> *run-attack-mods* turnvv) 655360.0) (target-start-attack) (target-danger-set! 'flut-attack #f) - (when (and - (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) - ) + (when (and (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) + ) (let ((gp-0 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-0 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 32))) ) @@ -1715,40 +1673,37 @@ :trans (behavior () (when (!= (-> self state-time) (-> *display* base-frame-counter)) - (if (and - (or - (smack-surface? #t) - (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) - ) - (begin - (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) - (set! (-> self control unknown-float81) 0.0) - (let ((gp-0 (new-stack-vector0)) - (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - ) - 0.0 - (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) - (let* ((f0-5 (vector-length gp-0)) - (f1-1 f0-5) - (f2-1 (fmin 0.0 f30-0)) - ) - (vector+! - (-> self control transv) - (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) - (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) - ) - ) - ) - #t - ) - (or - (zero? (-> self control unknown-uint20)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) - ) - (!= (-> self control unknown-uint31) 1) - ) + (if (and (or (smack-surface? #t) + (and (>= (-> self control unknown-float63) 0.7) (zero? (logand (-> self control status) 32))) + ) + (begin + (set! (-> self control unknown-int21) (-> *display* base-frame-counter)) + (set! (-> self control unknown-float81) 0.0) + (let ((gp-0 (new-stack-vector0)) + (f30-0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + ) + 0.0 + (vector-! gp-0 (-> self control transv) (vector-float*! gp-0 (-> self control dynam gravity-normal) f30-0)) + (let* ((f0-5 (vector-length gp-0)) + (f1-1 f0-5) + (f2-1 (fmin 0.0 f30-0)) + ) + (vector+! + (-> self control transv) + (vector-float*! (-> self control transv) (-> self control dynam gravity-normal) f2-1) + (vector-float*! gp-0 gp-0 (/ f0-5 f1-1)) + ) + ) + ) + #t + ) + (or (zero? (-> self control unknown-uint20)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) + ) + ) + (!= (-> self control unknown-uint31) 1) + ) (target-shoved (meters 2.0) (-> *TARGET-bank* smack-surface-height) @@ -1756,10 +1711,9 @@ (the-as (state target) target-flut-hit) ) ) - (if (and - (logtest? (-> self water flags) 512) - (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) - ) + (if (and (logtest? (-> self water flags) 512) + (zero? (mod (- (-> *display* base-frame-counter) (-> self state-time)) 21)) + ) (dummy-13 (-> self water) (the-as float 0.6) @@ -1797,44 +1751,38 @@ (TODO-RENAME-9 (-> self align)) (when (not (ja-min? 0)) (cond - ((and - (>= (ja-aframe-num 0) 20.0) - (and - (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-39 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + ((and (>= (ja-aframe-num 0) 20.0) + (and (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-39 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not + (or (= v1-39 (-> self draw art-group data 59)) + (= v1-39 (-> self draw art-group data 60)) + (= v1-39 (-> self draw art-group data 61)) + ) ) - ) - ) - (or - (not - (or - (= v1-39 (-> self draw art-group data 59)) - (= v1-39 (-> self draw art-group data 60)) - (= v1-39 (-> self draw art-group data 61)) + (< 4096.0 (target-height-above-ground)) + ) + ) + ) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) + (the-as uint 12) ) - ) - (< 4096.0 (target-height-above-ground)) ) - ) - ) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint20)))) - (the-as uint 12) - ) - ) - ) + ) enter-state (go target-flut-falling) ) - ((and - (nonzero? (-> self control unknown-uint30)) - (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) - (the-as uint 12) - ) - ) + ((and (nonzero? (-> self control unknown-uint30)) + (>= (the-as uint (- (-> *display* base-frame-counter) (the-as int (-> self control unknown-uint30)))) + (the-as uint 12) + ) + ) (set-forward-vel (-> (new 'static 'array float 1 0.0) 0)) (set! f30-0 0.0) ) @@ -1867,26 +1815,23 @@ (set! f30-0 (* f30-0 (the-as float (fmin 1.0 (the-as float (-> self control unknown-float140)))))) ) ) - (when (and - (zero? (logand (-> self control status) 1)) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) - (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) - (let ((v1-105 (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) + (when (and (zero? (logand (-> self control status) 1)) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) (-> *FLUT-bank* ground-timeout)) + (>= 0.0 (vector-dot (-> self control dynam gravity-normal) (-> self control transv))) + (let ((v1-105 (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + ) + ) + (or (not (or (= v1-105 (-> self draw art-group data 59)) + (= v1-105 (-> self draw art-group data 60)) + (= v1-105 (-> self draw art-group data 61)) ) ) - ) - (or - (not (or - (= v1-105 (-> self draw art-group data 59)) - (= v1-105 (-> self draw art-group data 60)) - (= v1-105 (-> self draw art-group data 61)) - ) + (< 4096.0 (target-height-above-ground)) ) - (< 4096.0 (target-height-above-ground)) - ) - ) - ) + ) + ) enter-state (go target-flut-falling) ) @@ -1927,20 +1872,19 @@ (defstate target-flut-air-attack (target) :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) - (if (and - (= arg2 'touched) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> self control) - (the-as uint 6) + (if (and (= arg2 'touched) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> self control) + (the-as uint 6) + ) + (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) + ) + ) ) - (< 0.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (the-as vector (-> self control trans-old)) (-> self control trans)) - ) - ) - ) (send-event arg0 'bonk (-> arg3 param 0) (-> self control ground-impact-vel)) ) (case arg2 @@ -2014,18 +1958,15 @@ (remove-exit) (go target-flut-air-attack-hit-ground) ) - (when (if (and - (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0) - (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) - (not - (and - *cheat-mode* - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (when (if (and (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0) + (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + (not + (and *cheat-mode* + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) ) - ) - ) - ) + ) #t ) (logior! (-> self control status) 1) @@ -2199,10 +2140,9 @@ :trans (behavior () (when (= *cheat-mode* 'debug) - (when (and - (not *pause-lock*) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) + (when (and (not *pause-lock*) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) (pickup-collectable! (-> self fact-info-target) (pickup-type eco-green) (the-as float 1.0) (the-as handle #f)) (go target-flut-stance) ) @@ -2322,8 +2262,8 @@ (case (-> gp-0 angle) (('shove) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 158) ) ) @@ -2342,8 +2282,8 @@ ) (else (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 157) ) ) @@ -2617,7 +2557,11 @@ (none) ) :post - (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + (behavior () + (target-no-stick-post) + (target-flut-post-post) + (none) + ) ) ;; failed to figure out what this is: @@ -2736,7 +2680,11 @@ :enter (-> target-hit-ground enter) :trans - (behavior () (logior! (-> self control status) 7) ((-> target-hit-ground trans)) (none)) + (behavior () + (logior! (-> self control status) 7) + ((-> target-hit-ground trans)) + (none) + ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -2804,7 +2752,11 @@ :code (-> target-flut-stance code) :post - (behavior () (target-no-stick-post) (target-flut-post-post) (none)) + (behavior () + (target-no-stick-post) + (target-flut-post-post) + (none) + ) ) ;; failed to figure out what this is: @@ -2833,9 +2785,9 @@ (none) ) :post - (behavior () (target-no-ja-move-post) (target-flut-post-post) (none)) + (behavior () + (target-no-ja-move-post) + (target-flut-post-post) + (none) + ) ) - - - - diff --git a/test/decompiler/reference/levels/intro/evilbro_REF.gc b/test/decompiler/reference/levels/intro/evilbro_REF.gc index d80f48e231..64714b0a72 100644 --- a/test/decompiler/reference/levels/intro/evilbro_REF.gc +++ b/test/decompiler/reference/levels/intro/evilbro_REF.gc @@ -67,10 +67,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t @@ -205,7 +205,11 @@ (defstate idle (evilsis) :virtual #t :trans - (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none)) + (behavior () + (set! (-> self will-talk) #f) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) ) ;; definition for method 11 of type evilsis diff --git a/test/decompiler/reference/levels/jungle/darkvine_REF.gc b/test/decompiler/reference/levels/jungle/darkvine_REF.gc index ebe0caef6d..ba55d4a589 100644 --- a/test/decompiler/reference/levels/jungle/darkvine_REF.gc +++ b/test/decompiler/reference/levels/jungle/darkvine_REF.gc @@ -35,20 +35,17 @@ ;; definition for method 12 of type darkvine (defmethod run-logic? darkvine ((obj darkvine)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (and - (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status drwf03)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) - (vector-vector-distance (-> obj root-override 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-status drwf04))) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (logtest? (-> obj draw status) (draw-status drwf03)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root-override pause-adjust-distance)) + (vector-vector-distance (-> obj root-override 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-status drwf04))) + ) ) - ) ) ;; failed to figure out what this is: @@ -241,10 +238,9 @@ ) :post (behavior () - (when (and - (-> self hit-player) - (or (not *target*) (>= (- (-> *display* base-frame-counter) (the-as int (-> self touch-time))) 15)) - ) + (when (and (-> self hit-player) + (or (not *target*) (>= (- (-> *display* base-frame-counter) (the-as int (-> self touch-time))) 15)) + ) (dummy-54 (-> self root-override) 2 4) (set! (-> self hit-player) #f) ) diff --git a/test/decompiler/reference/levels/jungle/fisher-JUN_REF.gc b/test/decompiler/reference/levels/jungle/fisher-JUN_REF.gc index 70c7d23cc8..91eac625cd 100644 --- a/test/decompiler/reference/levels/jungle/fisher-JUN_REF.gc +++ b/test/decompiler/reference/levels/jungle/fisher-JUN_REF.gc @@ -1030,12 +1030,12 @@ ) ) (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1053,12 +1053,11 @@ (until (ja-done? 0) (fisher-fish-move) (if (< (vector-vector-xz-distance (-> self root trans) (-> (the-as fisher (-> self parent 0)) paddle-pos)) - (+ (-> *FISHER-bank* net-radius) (* (-> self size) (-> self root scale x))) - ) + (+ (-> *FISHER-bank* net-radius) (* (-> self size) (-> self root scale x))) + ) (go fisher-fish-caught) ) - (if (or - (>= (-> self pos) (the float (+ (-> (the-as fisher (-> self parent 0)) path curve num-cverts) -1))) + (if (or (>= (-> self pos) (the float (+ (-> (the-as fisher (-> self parent 0)) path curve num-cverts) -1))) (>= (-> self pos) 7.2) ) (go fisher-fish-die) @@ -1609,28 +1608,25 @@ ) (cond ((and (< 0.3 f0-2) (< (+ (-> *FISHER-bank* max-caught) -30) (-> self caught))) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) 3000) - (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-almost)) 3000) + (play-ambient (-> self ambient) "FIS-TA11" #t (-> self root-override trans)) + ) (set! (-> self ambient-almost) (-> *display* base-frame-counter)) ) ) ((< 0.125 f0-2) ) ((< 0.1 f0-2) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self ambient-steady)) 3000) - (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-steady)) 3000) + (play-ambient (-> self ambient) "FIS-TA06" #t (-> self root-override trans)) + ) (set! (-> self ambient-steady) (-> *display* base-frame-counter)) ) ) ((< (+ (-> *FISHER-bank* max-missed) -6) (-> self missed)) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self ambient-sagging)) 3000) - (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-sagging)) 3000) + (play-ambient (-> self ambient) "FIS-TA07" #t (-> self root-override trans)) + ) (set! (-> self ambient-sagging) (-> *display* base-frame-counter)) ) ) @@ -1672,17 +1668,15 @@ (set! (-> self spawner) 0.0) ) ) - (when (and - (nonzero? (-> self params period)) - (>= (- (-> *display* base-frame-counter) (-> self spawn-time)) (the-as int (-> self params period))) - ) + (when (and (nonzero? (-> self params period)) + (>= (- (-> *display* base-frame-counter) (-> self spawn-time)) (the-as int (-> self params period))) + ) (let ((gp-0 (cond ((rand-vu-percent? (-> self params powerup-percent)) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self ambient-big-one)) 9000) - (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self ambient-big-one)) 9000) + (play-ambient (-> self ambient) "FIS-TA03" #t (-> self root-override trans)) + ) (set! (-> self ambient-big-one) (-> *display* base-frame-counter)) ) 'powerup @@ -1847,8 +1841,7 @@ (while #t (hide-hud-quick) (fisher-game-update) - (if (or - (zero? (-> self params timeout)) + (if (or (zero? (-> self params timeout)) (>= (-> self missed) (-> *FISHER-bank* max-missed)) (>= (-> self caught) (-> *FISHER-bank* max-caught)) ) @@ -1859,7 +1852,10 @@ (none) ) :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -2164,10 +2160,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 60) ) (while #t @@ -2185,12 +2181,12 @@ ) ) (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2217,8 +2213,8 @@ ) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) (let ((a0-19 (-> self skel root-channel 0))) @@ -2426,12 +2422,12 @@ (let ((a0-28 (-> self skel root-channel 0))) (set! (-> a0-28 param 0) (* (fmax 0.0 (- 1.0 (-> (the-as fisher v1-42) paddle))) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/jungle/hopper_REF.gc b/test/decompiler/reference/levels/jungle/hopper_REF.gc index 53eca4164a..8bb50cbfe1 100644 --- a/test/decompiler/reference/levels/jungle/hopper_REF.gc +++ b/test/decompiler/reference/levels/jungle/hopper_REF.gc @@ -191,8 +191,8 @@ nav-enemy-default-event-handler (while #t (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) (ja-channel-push! 1 20) @@ -216,8 +216,8 @@ nav-enemy-default-event-handler (ja-channel-push! 1 30) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 9) ) (ja-channel-push! 1 30) @@ -283,7 +283,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) ) ;; failed to figure out what this is: @@ -309,8 +312,8 @@ nav-enemy-default-event-handler (while #t (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) (ja-channel-push! 1 20) @@ -334,8 +337,8 @@ nav-enemy-default-event-handler (ja-channel-push! 1 30) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 9) ) (ja-channel-push! 1 30) @@ -396,7 +399,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-stare) (none)) + (behavior () + (go-virtual nav-enemy-stare) + (none) + ) ) ;; definition for symbol *hopper-nav-enemy-info*, type nav-enemy-info diff --git a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc index 2e9ffcb1d3..e074138c33 100644 --- a/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-mirrors_REF.gc @@ -1487,7 +1487,10 @@ ) ) :enter - (behavior () (clear-collide-with-as (-> self root-override)) (none)) + (behavior () + (clear-collide-with-as (-> self root-override)) + (none) + ) :exit (behavior () (restore-collide-with-as (-> self root-override)) @@ -1619,10 +1622,9 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch) - (when (and *target* (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) ) ) (when ((method-of-type touching-shapes-entry prims-touching?) @@ -1650,7 +1652,10 @@ ) ) :exit - (behavior () (sound-stop (-> self grips-sound-id)) (none)) + (behavior () + (sound-stop (-> self grips-sound-id)) + (none) + ) :code (behavior () (hide-hud) @@ -1784,7 +1789,10 @@ (none) ) :trans - (behavior () (hide-hud) (none)) + (behavior () + (hide-hud) + (none) + ) :code (behavior () (set! (-> self lock-time) (the-as uint (-> *display* base-frame-counter))) @@ -1898,10 +1906,9 @@ (set! (-> self lock-time) (the-as uint (-> *display* base-frame-counter))) ) (periscope-crosshair) - (when (or - (cpad-pressed? 0 triangle x) - (and (-> self aligned?) (>= (- (-> *display* base-frame-counter) (the-as int (-> self lock-time))) 900)) - ) + (when (or (cpad-pressed? 0 triangle x) + (and (-> self aligned?) (>= (- (-> *display* base-frame-counter) (the-as int (-> self lock-time))) 900)) + ) (sound-stop (-> self sound-id)) (if (periscope-test-task-complete?) (close-specific-task! (game-task jungle-lurkerm) (task-status need-reminder)) @@ -1939,11 +1946,10 @@ (run-next-time-in-process gp-2 (lambda ((arg0 string)) - (while (or - (-> *setting-control* current ambient) - (-> *setting-control* current movie) - (-> *setting-control* current hint) - ) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current movie) + (-> *setting-control* current hint) + ) (suspend) ) (cond @@ -2003,7 +2009,12 @@ (none) ) :post - (behavior () (periscope-draw-beam) (periscope-update-joints) (ja-post) (none)) + (behavior () + (periscope-draw-beam) + (periscope-update-joints) + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -2216,7 +2227,10 @@ (none) ) :post - (behavior () (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) (none)) + (behavior () + (draw-power-beam (-> self reflector-trans) (-> self next-reflector-trans)) + (none) + ) ) ;; definition for method 11 of type reflector-origin @@ -2246,7 +2260,10 @@ ) ) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :code (behavior () (let ((gp-0 (new-stack-vector0))) @@ -2445,10 +2462,9 @@ ) ) ) - (if (and - (< 4096.0 (vector-vector-distance (camera-pos) arg0)) - (< 4096.0 (vector-vector-distance (camera-pos) arg1)) - ) + (if (and (< 4096.0 (vector-vector-distance (camera-pos) arg0)) + (< 4096.0 (vector-vector-distance (camera-pos) arg1)) + ) (draw-eco-beam arg0 arg1) ) ) diff --git a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc index 76910a0ce4..b7855dd079 100644 --- a/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc +++ b/test/decompiler/reference/levels/jungle/jungle-obs_REF.gc @@ -856,12 +856,13 @@ ;; failed to figure out what this is: (defstate precurbridge-idle (precurbridge) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('go) - (go precurbridge-activate) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('go) + (go precurbridge-activate) + ) + ) + ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -874,13 +875,12 @@ ) (transform-post) (while #t - (when (and - *target* - (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) - (< (-> self activation-point y) (-> *target* control trans y)) - (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) - (not (-> self child)) - ) + (when (and *target* + (< (vector-vector-xz-distance (-> self activation-point) (-> *target* control trans)) 49152.0) + (< (-> self activation-point y) (-> *target* control trans y)) + (< (-> *target* control trans y) (+ 20480.0 (-> self activation-point y))) + (not (-> self child)) + ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) @@ -943,7 +943,10 @@ ;; failed to figure out what this is: (defstate precurbridge-activate (precurbridge) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (the-as (function none :behavior precurbridge) rider-trans) :code @@ -1031,8 +1034,8 @@ (cond ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) ) @@ -1049,8 +1052,8 @@ ) (else (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 4) ) ) @@ -1312,16 +1315,13 @@ (suspend) (dummy-47 (-> self root-override)) (while #t - (when (or - (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (and - (and - *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (send-event *target* 'query 'powerup 3) + (when (or (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (and (and *target* + (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + (send-event *target* 'query 'powerup 3) + ) ) - ) (sound-play-by-name (static-sound-name "blue-eco-on") (new-sound-id) @@ -1333,10 +1333,9 @@ ) (go maindoor-open #f) ) - (if (and - *target* - (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= (-> self thresh w) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (level-hint-spawn (game-text-id jungle-maindoor-hint) "sksp0038" @@ -1418,15 +1417,12 @@ (initialize-skeleton obj *maindoor-sg* '()) (dummy-47 (-> obj root-override)) (set! (-> obj thresh w) 61440.0) - (if (or - (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (and - (and - *target* - (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) - ) - (send-event *target* 'query 'powerup 3) - ) + (if (or (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) + (and (and *target* + (>= (-> obj thresh w) (vector-vector-distance (-> obj root-override trans) (-> *target* control trans))) + ) + (send-event *target* 'query 'powerup 3) + ) ) (go maindoor-open #t) (go maindoor-closed #t) diff --git a/test/decompiler/reference/levels/jungle/junglefish_REF.gc b/test/decompiler/reference/levels/jungle/junglefish_REF.gc index c70a94052c..0fe9313ea5 100644 --- a/test/decompiler/reference/levels/jungle/junglefish_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglefish_REF.gc @@ -48,7 +48,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) (none)) + (behavior () + (set! (-> self target-speed) (-> self nav-info walk-travel-speed)) + (none) + ) :code (behavior () (ja-channel-push! 1 60) @@ -187,7 +190,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) ) ;; failed to figure out what this is: @@ -217,7 +223,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) ) ;; failed to figure out what this is: @@ -229,7 +238,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) ) ;; failed to figure out what this is: @@ -241,7 +253,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :code - (behavior () (go-virtual nav-enemy-patrol) (none)) + (behavior () + (go-virtual nav-enemy-patrol) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc index 5332d7bb68..7d054d3310 100644 --- a/test/decompiler/reference/levels/jungle/junglesnake_REF.gc +++ b/test/decompiler/reference/levels/jungle/junglesnake_REF.gc @@ -412,7 +412,12 @@ junglesnake-default-event-handler (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -483,17 +488,15 @@ junglesnake-default-event-handler ) :trans (behavior () - (if (and - (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) - (zero? (logand (-> *target* state-flags) #x80f8)) - ) + (if (and (and *target* (>= 24576.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self refractory-delay)) + (zero? (logand (-> *target* state-flags) #x80f8)) + ) (go junglesnake-attack) ) (when *target* (let ((a0-8 (target-pos 0))) - (if (or - (>= (- (-> a0-8 y) (-> self root-override trans y)) 57344.0) + (if (or (>= (- (-> a0-8 y) (-> self root-override trans y)) 57344.0) (>= (vector-vector-xz-distance a0-8 (-> self root-override trans)) 163840.0) ) (go junglesnake-give-up) @@ -517,8 +520,8 @@ junglesnake-default-event-handler (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 2) ) (while (not (ja-done? 0)) @@ -564,9 +567,15 @@ junglesnake-default-event-handler :event junglesnake-default-event-handler :enter - (behavior () (set! (-> self hit-player) #f) (none)) + (behavior () + (set! (-> self hit-player) #f) + (none) + ) :exit - (behavior () (dummy-24 self) (none)) + (behavior () + (dummy-24 self) + (none) + ) :trans (behavior () (dummy-20 self) @@ -666,7 +675,10 @@ junglesnake-default-event-handler (none) ) :trans - (behavior () (dummy-20 self) (none)) + (behavior () + (dummy-20 self) + (none) + ) :code (behavior () (ja-channel-push! 1 30) diff --git a/test/decompiler/reference/levels/jungleb/aphid_REF.gc b/test/decompiler/reference/levels/jungleb/aphid_REF.gc index c1277f0458..c2f10de008 100644 --- a/test/decompiler/reference/levels/jungleb/aphid_REF.gc +++ b/test/decompiler/reference/levels/jungleb/aphid_REF.gc @@ -177,10 +177,9 @@ (behavior () (set! (-> self turn-time) 60) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or - (logtest? (-> self nav-enemy-flags) 256) - (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - ) + (when (or (logtest? (-> self nav-enemy-flags) 256) + (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) + ) (ja-channel-push! 1 30) (let ((a0-3 (-> self skel root-channel 0))) (set! (-> a0-3 frame-group) (the-as art-joint-anim (-> self draw art-group data 10))) @@ -227,11 +226,11 @@ ) (when (nav-enemy-rnd-percent? 0.3) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 10) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 10) + ) + ) (ja-channel-push! 1 30) ) (let ((a0-22 (-> self skel root-channel 0))) @@ -270,8 +269,8 @@ (s5-0 (target-pos 0)) ) (when (< (fabs - (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) - ) + (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) + ) 12743.111 ) (let ((a0-6 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc index 81e023de9e..7c89e61cd1 100644 --- a/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc +++ b/test/decompiler/reference/levels/jungleb/jungleb-obs_REF.gc @@ -262,7 +262,10 @@ ) ) :exit - (behavior () (sound-stop (-> self sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (none) + ) :trans (behavior () (if (and (not (-> self child)) (task-complete? *game-info* (-> self entity extra perm task))) @@ -273,7 +276,12 @@ (none) ) :code - (behavior () (suspend) (dummy-47 (-> self root-override)) (anim-loop) (none)) + (behavior () + (suspend) + (dummy-47 (-> self root-override)) + (anim-loop) + (none) + ) :post (the-as (function none :behavior eggtop) ja-post) ) @@ -281,7 +289,11 @@ ;; failed to figure out what this is: (defstate eggtop-close (eggtop) :trans - (behavior () (rider-trans) (hide-hud-quick) (none)) + (behavior () + (rider-trans) + (hide-hud-quick) + (none) + ) :code (behavior ((arg0 symbol)) (when (not arg0) diff --git a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc index a8e5bcdf80..032410af5d 100644 --- a/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc +++ b/test/decompiler/reference/levels/jungleb/plant-boss_REF.gc @@ -277,19 +277,18 @@ (defbehavior plant-boss-default-event-handler plant-boss ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) - (if (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 1) - ) - (not (= (if (> (-> self skel active-channels) 0) + (if (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 1) + ) + (not (= (if (> (-> self skel active-channels) 0) (-> self skel root-channel 0 frame-group) ) - (-> self draw art-group data 13) - ) - ) - ) + (-> self draw art-group data 13) + ) + ) + ) (send-event arg0 'attack-or-shove (-> arg3 param 0) (new 'static 'attack-info)) ) ) @@ -1462,13 +1461,11 @@ ) (until (ja-done? 0) (set! (-> self energy) (seek (-> self energy) (the-as float 0.25) (-> *display* seconds-per-frame))) - (if (and - (and - *target* - (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (< (fabs (- (-> (target-pos 0) y) (-> self root-override trans y))) 40960.0) - ) + (if (and (and *target* + (>= 245760.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + (< (fabs (- (-> (target-pos 0) y) (-> self root-override trans y))) 40960.0) + ) (go plant-boss-intro) ) (suspend) @@ -1509,26 +1506,25 @@ (if (< 409600.0 f30-0) (go plant-boss-far-idle) ) - (if (and - (< f30-0 143360.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (cond - ((>= (-> self try) 15) - 1500 - ) - ((>= (-> self try) 10) - 1200 - ) - ((>= (-> self try) 5) - 900 - ) - (else - 600 + (if (and (< f30-0 143360.0) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (cond + ((>= (-> self try) 15) + 1500 ) - ) - ) - *target* - (zero? (logand (-> *target* state-flags) #x80f8)) - ) + ((>= (-> self try) 10) + 1200 + ) + ((>= (-> self try) 5) + 900 + ) + (else + 600 + ) + ) + ) + *target* + (zero? (logand (-> *target* state-flags) #x80f8)) + ) (go plant-boss-attack 1) ) ) @@ -1538,8 +1534,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) (ja-channel-push! 1 150) @@ -1563,8 +1559,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 12) ) (ja-channel-push! 1 75) @@ -1610,8 +1606,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 10) ) ) @@ -1922,19 +1918,18 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('touch 'attack) - (when (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 1) - ) - (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 13) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 1) + ) + (not (= (if (> (-> self skel active-channels) 0) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 13) + ) ) - ) - ) + ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) @@ -1966,10 +1961,10 @@ (set! (-> self interp) 0.0) (let ((s5-0 #f)) (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 7) + ) (set! s5-0 #t) ) (ja-channel-push! 2 75) @@ -2073,10 +2068,10 @@ :code (behavior () (let ((f30-1 (if (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) (fmax (-> (new 'static 'array float 1 129.0) 0) (ja-aframe-num 0)) (-> (new 'static 'array float 1 129.0) 0) ) @@ -2183,8 +2178,8 @@ (let ((gp-0 #f)) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 10) ) (set! gp-0 #t) @@ -2479,7 +2474,11 @@ (none) ) :post - (behavior () (plant-boss-post) (dummy-45 (-> self root-override)) (none)) + (behavior () + (plant-boss-post) + (dummy-45 (-> self root-override)) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc b/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc index c93c6961b1..d0a612b79f 100644 --- a/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc +++ b/test/decompiler/reference/levels/lavatube/assistant-lavatube_REF.gc @@ -68,32 +68,29 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) - (when (and - (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - #t + (when (and (cond + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + #t + ) + (else + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) + ) + (and (not (closed? (-> self tasks) (game-task lavatube-start) (task-status need-reward-speech))) + (not (movie?)) + (not (level-hint-displayed?)) + (not (and *cheat-mode* (cpad-hold? 0 l3))) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) + ) ) - (else - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) - (and - (not (closed? (-> self tasks) (game-task lavatube-start) (task-status need-reward-speech))) - (not (movie?)) - (not (level-hint-displayed?)) - (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) - ) - ) (hide-hud) (kill-current-level-hint '() '(sidekick voicebox) 'exit) - (when (and - (seen-text? *game-info* (game-text-id assistant-lavatube-powercell-hint)) - (hud-hidden?) - (can-grab-display? self) - (not (-> *setting-control* current hint)) - ) + (when (and (seen-text? *game-info* (game-text-id assistant-lavatube-powercell-hint)) + (hud-hidden?) + (can-grab-display? self) + (not (-> *setting-control* current hint)) + ) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -130,8 +127,8 @@ (behavior () (while #t (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (get-art-elem self) ) (ja-channel-push! 1 15) @@ -150,12 +147,12 @@ ) ) (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc index 7693a6a1ec..3ad1b9d4e4 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-energy_REF.gc @@ -549,12 +549,12 @@ (set! (-> a0-0 param 0) 0.0) (set! (-> a0-0 param 1) 1.0) (set! (-> a0-0 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -575,8 +575,7 @@ (joint-control-channel-group-eval! a0-1 (the-as art-joint-anim #f) num-func-seek!) ) ) - (if (or - (task-closed? (-> self entity extra perm task) (task-status need-resolution)) + (if (or (task-closed? (-> self entity extra perm task) (task-status need-resolution)) (< (energydoor-player-dist) 0.0) ) (go energydoor-closed-till-near) @@ -618,12 +617,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -843,12 +842,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -886,12 +885,13 @@ ;; failed to figure out what this is: (defstate energybase-idle (energybase) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('stop) - (go energybase-stopping) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('stop) + (go energybase-stopping) + ) + ) + ) :code (behavior () (while #t @@ -910,12 +910,12 @@ ) ) (set! (-> a0-2 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1148,12 +1148,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1270,7 +1270,10 @@ ;; failed to figure out what this is: (defstate energyarm-stop (energyarm) :enter - (behavior () '() (none)) + (behavior () + '() + (none) + ) :trans (behavior () (update! (-> self x-rotation) 0.0) @@ -1287,12 +1290,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1325,14 +1328,18 @@ ;; failed to figure out what this is: (defstate energyarm-no-ball (energyarm) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('stop) - (go energyarm-stop) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('stop) + (go energyarm-stop) + ) + ) + ) :enter - (behavior () (set! (-> self y-chatter-rotation osc target) 1.0) (none)) + (behavior () + (set! (-> self y-chatter-rotation osc target) 1.0) + (none) + ) :trans (behavior () (set! (-> self x-correction) (fmax -1.0 (+ -0.1 (-> self x-correction)))) @@ -1369,12 +1376,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1407,7 +1414,10 @@ ;; failed to figure out what this is: (defstate energyarm-fall (energyarm) :enter - (behavior () (set! (-> self x-fall-rotation osc target) 1.0) (none)) + (behavior () + (set! (-> self x-fall-rotation osc target) 1.0) + (none) + ) :trans (behavior () (update! (-> self x-fall-rotation) 0.0) @@ -1431,12 +1441,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1469,12 +1479,13 @@ ;; failed to figure out what this is: (defstate energyarm-idle (energyarm) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('stop) - (go energyarm-stop) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('stop) + (go energyarm-stop) + ) + ) + ) :trans (behavior () (update! (-> self x-rotation) 0.0) @@ -1633,13 +1644,12 @@ ;; definition for function energyhub-trans (defbehavior energyhub-trans energyhub () - (+! - (-> self y-rotation) - (* 36.40889 - (-> self rotation-speed value) - (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) - ) - ) + (+! (-> self y-rotation) + (* 36.40889 + (-> self rotation-speed value) + (the float (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) + ) + ) (cond ((< 65536.0 (-> self y-rotation)) (set! (-> self y-rotation) (+ -65536.0 (-> self y-rotation))) @@ -2002,12 +2012,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc index e75808fc39..6c6a3cf9b4 100644 --- a/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc +++ b/test/decompiler/reference/levels/lavatube/lavatube-obs_REF.gc @@ -38,12 +38,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -120,12 +120,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -202,12 +202,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -741,25 +741,24 @@ (cond ((= arg0 *target*) (let ((s5-0 (-> arg3 param 0))) - (if (and - s5-0 - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry s5-0) - (-> self root-override) - (the-as uint 1) - ) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'attack-invinc) - (set! (-> a1-2 param 0) s5-0) - (let ((a0-4 (new 'static 'attack-info :mask #x20))) - (set! (-> a0-4 mode) 'death) - (set! (-> a1-2 param 1) (the-as uint a0-4)) - ) - (send-event-function arg0 a1-2) + (if (and s5-0 + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry s5-0) + (-> self root-override) + (the-as uint 1) ) - ) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'attack-invinc) + (set! (-> a1-2 param 0) s5-0) + (let ((a0-4 (new 'static 'attack-info :mask #x20))) + (set! (-> a0-4 mode) 'death) + (set! (-> a1-2 param 1) (the-as uint a0-4)) + ) + (send-event-function arg0 a1-2) + ) + ) (go darkecobarrel-mover-die) ) ) @@ -964,12 +963,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1121,12 +1120,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1203,12 +1202,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1520,12 +1519,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1784,12 +1783,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1949,12 +1948,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc index aaf9a45055..1dc3b61de7 100644 --- a/test/decompiler/reference/levels/maincave/baby-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/baby-spider_REF.gc @@ -391,15 +391,14 @@ baby-spider-default-event-handler ((TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) - ((and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - (nonzero? (-> self draw)) - (logtest? (-> self draw status) (draw-status drwf03)) - ) + ((and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (nonzero? (-> self draw)) + (logtest? (-> self draw status) (draw-status drwf03)) + ) (go-virtual nav-enemy-patrol) ) ) @@ -441,7 +440,10 @@ baby-spider-default-event-handler (none) ) :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -597,7 +599,11 @@ baby-spider-default-event-handler (none) ) :post - (behavior () (dummy-52 self (target-pos 0)) (nav-enemy-travel-post) (none)) + (behavior () + (dummy-52 self (target-pos 0)) + (nav-enemy-travel-post) + (none) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc index 0270c05778..06918fd25d 100644 --- a/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc +++ b/test/decompiler/reference/levels/maincave/driller-lurker_REF.gc @@ -291,13 +291,11 @@ ) (while s0-0 (set! sv-96 (get-touched-prim s0-0 (-> self root-overeride) (the-as touching-prims-entry s1-0))) - (if (and - (logtest? - (-> (get-touched-prim s0-0 (-> s4-0 control) (the-as touching-prims-entry s1-0)) prim-core action) - 1 - ) - (logtest? (-> sv-96 prim-id) 1) - ) + (if (and (logtest? (-> (get-touched-prim s0-0 (-> s4-0 control) (the-as touching-prims-entry s1-0)) prim-core action) + 1 + ) + (logtest? (-> sv-96 prim-id) 1) + ) (set! s2-0 #t) ) (if (logtest? (-> sv-96 prim-id) 2) @@ -567,14 +565,12 @@ 0 ) ) - (when (and - (-> obj hit-player?) - (or (not *target*) (and - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj hit-player-time))) 15) - ) - ) - ) + (when (and (-> obj hit-player?) + (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> obj hit-player-time))) 15) + ) + ) + ) (dummy-54 (-> obj root-overeride) 2 1) (set! (-> obj hit-player?) #f) #f @@ -640,11 +636,10 @@ (let* ((a1-0 (target-pos 0)) (f0-1 (- (-> a1-0 y) (-> obj root-overeride trans y))) ) - (if (and - (< f0-1 40960.0) - (< -10240.0 f0-1) - (< (vector-vector-xz-distance (-> obj root-overeride trans) a1-0) 143360.0) - ) + (if (and (< f0-1 40960.0) + (< -10240.0 f0-1) + (< (vector-vector-xz-distance (-> obj root-overeride trans) a1-0) 143360.0) + ) (return #f) ) ) @@ -696,7 +691,10 @@ ;; failed to figure out what this is: (defstate driller-lurker-debug-play-anims (driller-lurker) :code - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :post (the-as (function none :behavior driller-lurker) transform-post) ) @@ -714,7 +712,10 @@ (none) ) :exit - (behavior () (stop! (-> self sound2)) (none)) + (behavior () + (stop! (-> self sound2)) + (none) + ) :trans (behavior () (if (dummy-25 self) @@ -854,10 +855,9 @@ ) ) (when (ja-done? 0) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) - (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self timeout)) + (>= 546.13336 (fabs (deg- (-> self path-ry) (-> self facing-ry)))) + ) (go driller-lurker-patrol-pause) ) (let ((v1-34 (-> self skel root-channel 0))) @@ -905,11 +905,11 @@ (cond ((zero? v1-0) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 5) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 5) + ) + ) (ja-channel-push! 1 60) ) (let ((s4-0 (-> self skel root-channel 0))) @@ -923,11 +923,11 @@ ) ((= v1-0 1) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 6) + ) + ) (ja-channel-push! 1 60) ) (let ((s4-1 (-> self skel root-channel 0))) @@ -941,11 +941,11 @@ ) ((= v1-0 2) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 7) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 7) + ) + ) (ja-channel-push! 1 60) ) (let ((s4-2 (-> self skel root-channel 0))) @@ -1171,7 +1171,10 @@ (none) ) :trans - (behavior () (dummy-20 self #f (the-as target #f)) (none)) + (behavior () + (dummy-20 self #f (the-as target #f)) + (none) + ) :code (behavior () (ja-channel-push! 1 60) diff --git a/test/decompiler/reference/levels/maincave/gnawer_REF.gc b/test/decompiler/reference/levels/maincave/gnawer_REF.gc index f2eff91ef6..bc67370fcf 100644 --- a/test/decompiler/reference/levels/maincave/gnawer_REF.gc +++ b/test/decompiler/reference/levels/maincave/gnawer_REF.gc @@ -901,10 +901,10 @@ (s3-0 (get-death-count *game-info* #f)) (s5-0 (-> obj money-mask)) ) - (when (and *target* (or - (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) - (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) - ) + (when (and *target* + (or (and (= s3-0 1) (and (>= 1.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.1))) + (and (< 1 s3-0) (and (>= 2.0 (-> *target* fact-info-target health)) (rand-vu-percent? 0.05))) + ) ) (let ((v1-14 (dummy-28 obj s4-0 (the-as int s5-0)))) (logior s5-0 (the-as uint v1-14)) @@ -1015,7 +1015,10 @@ ) ) :exit - (behavior () (stop! (-> self sound2)) (none)) + (behavior () + (stop! (-> self sound2)) + (none) + ) :trans (behavior () (if (and *target* (>= 81920.0 (vector-vector-distance (target-pos 0) (-> self root-override trans)))) @@ -1036,12 +1039,12 @@ ) (set! (-> gp-0 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1058,12 +1061,12 @@ ) (set! (-> gp-1 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1221,7 +1224,10 @@ ;; failed to figure out what this is: (defstate gnawer-retreat-into-post (gnawer) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :code (behavior () (logclear! (-> self mask) (process-mask actor-pause)) @@ -1311,15 +1317,14 @@ (return #f) ) (let* ((a2-1 (the-as object (-> arg3 param 0))) - (v1-19 - (-> (get-touched-prim - (-> (the-as touching-shapes-entry a2-1) head) - (-> self root-override) - (the-as touching-prims-entry a2-1) - ) - prim-id - ) - ) + (v1-19 (-> (get-touched-prim + (-> (the-as touching-shapes-entry a2-1) head) + (-> self root-override) + (the-as touching-prims-entry a2-1) + ) + prim-id + ) + ) (v1-22 (-> self segments v1-19)) ) (spawn (-> self part) (-> v1-22 world-pos)) @@ -1344,7 +1349,11 @@ (none) ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (stop! (-> self sound)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (stop! (-> self sound)) + (none) + ) :trans (behavior () (+! (-> self route-dist) (* (-> self speed) (-> *display* seconds-per-frame))) @@ -1495,7 +1504,10 @@ ) ) :trans - (behavior () (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) (none)) + (behavior () + (spool-push *art-control* "maincavecam-gnawer-fuel-cell" 0 self -1.0) + (none) + ) :code (behavior () (local-vars (sv-128 symbol)) @@ -1585,28 +1597,28 @@ (set-vector! gp-0 4503813.0 46363.85 -12796366.0 1.0) (let ((s5-0 (the-as maincavecam (get-process *default-dead-pool* maincavecam #x4000)))) (set! (-> (the-as - maincavecam - (-> (when s5-0 - (let ((t9-4 (method-of-type maincavecam activate))) - (t9-4 s5-0 self 'maincavecam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - gp-0 - *maincavecam-sg* - (new 'static 'spool-anim :name "maincavecam-gnawer-fuel-cell" :index 3 :parts 1 :command-list '()) - 0 - self - '() - ) - (-> s5-0 ppointer) - ) - 0 - ) + maincavecam + (-> (when s5-0 + (let ((t9-4 (method-of-type maincavecam activate))) + (t9-4 s5-0 self 'maincavecam (the-as pointer #x70004000)) + ) + (run-now-in-process + s5-0 + pov-camera-init-by-other + gp-0 + *maincavecam-sg* + (new 'static 'spool-anim :name "maincavecam-gnawer-fuel-cell" :index 3 :parts 1 :command-list '()) + 0 + self + '() + ) + (-> s5-0 ppointer) ) - seq - ) + 0 + ) + ) + seq + ) (the-as uint 0) ) ) diff --git a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc index 4d732a3456..83a4e2963e 100644 --- a/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc +++ b/test/decompiler/reference/levels/maincave/maincave-obs_REF.gc @@ -169,11 +169,11 @@ (the-as object (when (or (= v1-0 'touch) (= v1-0 'attack)) (when (= (-> arg0 type) target) (if ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> *target* control) - (the-as uint 1) - (the-as uint 0) - ) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> *target* control) + (the-as uint 1) + (the-as uint 0) + ) (target-attack-up *target* 'attack-or-shove 'deadlyup) ) ) @@ -385,20 +385,16 @@ (suspend) (ja-eval) ) - (until (or - (or - (not *target*) - (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (and - (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (until (or (or (not *target*) + (< 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + (and (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) + (zero? (logand (-> *target* control root-prim prim-core action) 128)) ) - (zero? (logand (-> *target* control root-prim prim-core action) 128)) ) - ) (let ((a0-14 (-> self skel root-channel 0))) (set! (-> a0-14 frame-group) (the-as art-joint-anim (-> self draw art-group data 7))) (set! (-> a0-14 param 0) @@ -428,16 +424,13 @@ (joint-control-channel-group! a0-27 (the-as art-joint-anim (-> self draw art-group data 8)) num-func-seek!) ) (until (ja-done? 0) - (when (and - (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (or - (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - (logtest? (-> *target* control root-prim prim-core action) 128) - ) - ) + (when (and (and *target* (>= 28672.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (or (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + (logtest? (-> *target* control root-prim prim-core action) 128) + ) + ) (while (not (ja-min? 0)) (suspend) (let ((a0-38 (-> self skel root-channel 0))) @@ -622,11 +615,10 @@ (let ((s4-0 (new 'stack 'attack-info))) (dummy-41 (-> self root-override) s4-0 (-> self shove-up)) (cond - ((or - (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) -60) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) + ((or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) -60) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) + ) (let ((a1-5 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-5 from) self) (set! (-> a1-5 num-params) 2) @@ -972,9 +964,9 @@ ) ) (case (-> (if (-> obj entity) - (-> obj entity extra level) - (-> *level* level-default) - ) + (-> obj entity extra level) + (-> *level* level-default) + ) name ) (('darkcave) @@ -1252,11 +1244,21 @@ ) ) :enter - (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans - (behavior () (rider-trans) (TODO-RENAME-20 self) (none)) + (behavior () + (rider-trans) + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (while #t @@ -1283,7 +1285,11 @@ (none) ) :post - (behavior () (rider-post) (TODO-RENAME-21 self) (none)) + (behavior () + (rider-post) + (TODO-RENAME-21 self) + (none) + ) ) ;; failed to figure out what this is: @@ -1296,17 +1302,20 @@ (go caveelevator-one-way-travel-to-end) ) (('attack 'touch) - (if (and - (= (-> arg0 type) target) - (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) - ) + (if (and (= (-> arg0 type) target) + (>= 8192.0 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) + ) (go caveelevator-one-way-travel-to-end) ) ) ) ) :trans - (behavior () (rider-trans) (TODO-RENAME-20 self) (none)) + (behavior () + (rider-trans) + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -1328,7 +1337,11 @@ (none) ) :post - (behavior () (rider-post) (TODO-RENAME-21 self) (none)) + (behavior () + (rider-post) + (TODO-RENAME-21 self) + (none) + ) ) ;; failed to figure out what this is: @@ -1343,11 +1356,21 @@ ) ) :enter - (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans - (behavior () (rider-trans) (TODO-RENAME-20 self) (none)) + (behavior () + (rider-trans) + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -1375,7 +1398,11 @@ (none) ) :post - (behavior () (rider-post) (TODO-RENAME-21 self) (none)) + (behavior () + (rider-post) + (TODO-RENAME-21 self) + (none) + ) ) ;; failed to figure out what this is: @@ -1390,7 +1417,10 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (cond @@ -1425,7 +1455,11 @@ (none) ) :post - (behavior () (rider-post) (TODO-RENAME-21 self) (none)) + (behavior () + (rider-post) + (TODO-RENAME-21 self) + (none) + ) ) ;; failed to figure out what this is: @@ -1440,11 +1474,21 @@ ) ) :enter - (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans - (behavior () (rider-trans) (TODO-RENAME-20 self) (none)) + (behavior () + (rider-trans) + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) @@ -1472,7 +1516,11 @@ (none) ) :post - (behavior () (rider-post) (TODO-RENAME-21 self) (none)) + (behavior () + (rider-post) + (TODO-RENAME-21 self) + (none) + ) ) ;; definition for function caveelevator-joint-callback diff --git a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc index a511a26902..035259ff6b 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider-egg_REF.gc @@ -262,7 +262,10 @@ ) ) :enter - (behavior () (set! (-> self falling-start-time) (the-as uint (-> *display* base-frame-counter))) (none)) + (behavior () + (set! (-> self falling-start-time) (the-as uint (-> *display* base-frame-counter))) + (none) + ) :trans (behavior () (let ((f30-0 (fmin diff --git a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc index 7abfcab5c9..ecb5f00ef9 100644 --- a/test/decompiler/reference/levels/maincave/mother-spider_REF.gc +++ b/test/decompiler/reference/levels/maincave/mother-spider_REF.gc @@ -422,10 +422,9 @@ ;; definition for method 31 of type mother-spider (defmethod is-player-stuck? mother-spider ((obj mother-spider)) - (when (and *target* (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (when (and *target* (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) ) ) (let* ((v1-10 (target-pos 0)) @@ -510,10 +509,9 @@ (defmethod grab-player? mother-spider ((obj mother-spider)) (when *target* (let ((s5-0 (target-pos 0))) - (when (and - (>= 40960.0 (- (-> obj thread-min-trans y) (-> s5-0 y))) - (>= (-> obj activate-xz-dist) (vector-vector-xz-distance (-> obj thread-min-trans) s5-0)) - ) + (when (and (>= 40960.0 (- (-> obj thread-min-trans y) (-> s5-0 y))) + (>= (-> obj activate-xz-dist) (vector-vector-xz-distance (-> obj thread-min-trans) s5-0)) + ) (cond ((-> obj check-z-thresh?) (let ((f0-3 (- (-> s5-0 z) (-> obj root-override trans z)))) @@ -543,8 +541,7 @@ (return #t) ) ) - (if (or - (>= (- (-> obj thread-min-trans y) (-> a1-0 y)) 49152.0) + (if (or (>= (- (-> obj thread-min-trans y) (-> a1-0 y)) 49152.0) (>= (vector-vector-xz-distance (-> obj thread-min-trans) a1-0) (-> obj deactivate-xz-dist)) ) (return #t) @@ -772,10 +769,9 @@ (vector-reflect! (-> obj swing-vel) (-> obj swing-vel) (the-as vector (&-> s5-1 param 6))) (set! (-> obj swing-vel y) 0.0) (vector-normalize! (-> obj swing-vel) (* 0.5 (vector-length (-> obj swing-vel)))) - (when (and - (!= (-> obj spin-vel) 0.0) - (>= (- (-> *display* base-frame-counter) (the-as int (-> obj spin-time))) 150) - ) + (when (and (!= (-> obj spin-vel) 0.0) + (>= (- (-> *display* base-frame-counter) (the-as int (-> obj spin-time))) 150) + ) (set! (-> obj spin-vel) (* 0.75 (- (-> obj spin-vel)))) (set! (-> obj spin-time) (the-as uint (-> *display* base-frame-counter))) ) @@ -1071,7 +1067,10 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (none)) + (behavior () + (set! (-> self hit?) #f) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1158,19 +1157,17 @@ ) ) ) - (if (or (not *target*) (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) + (if (or (not *target*) (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) (set! (-> self last-player-in-air-time) (the-as uint (-> *display* base-frame-counter))) ) - (when (and - *target* - (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-spit-time))) 900) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-player-in-air-time))) 18) - (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - ) + (when (and *target* + (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-spit-time))) 900) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-player-in-air-time))) 18) + (>= (-> self max-spit-xz-dist) (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + ) (let ((gp-2 (new 'stack-no-clear 'vector)) (s5-2 (new 'stack-no-clear 'vector)) ) @@ -1200,8 +1197,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) (let ((a0-4 (-> self skel root-channel 0))) @@ -1248,7 +1245,10 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (none)) + (behavior () + (set! (-> self hit?) #f) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1312,7 +1312,11 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self hit?) #f) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1402,7 +1406,11 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self hit?) #f) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1411,21 +1419,18 @@ (if (letgo-player? self) (go mother-spider-traveling (the-as uint 0)) ) - (if (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> self started-birthing-time))) 1800) - (zero? (logand (-> *target* state-flags) #x80f8)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (the-as int (-> self started-birthing-time))) 1800) + (zero? (logand (-> *target* state-flags) #x80f8)) + ) (go mother-spider-traveling (the-as uint 1)) ) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 75) - (> (-> self birthing-counter) 0) - (and - (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) - (zero? (logand (-> *target* state-flags) #x80f8)) - (dummy-21 (-> self nav) (-> self root-override trans)) - ) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 75) + (> (-> self birthing-counter) 0) + (and (>= 49152.0 (- (-> self max-dist-from-anchor) (-> self dist-from-anchor))) + (zero? (logand (-> *target* state-flags) #x80f8)) + (dummy-21 (-> self nav) (-> self root-override trans)) + ) + ) (go mother-spider-birth-baby) ) (TODO-RENAME-29 self #t #t) @@ -1435,8 +1440,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) (let ((a0-4 (-> self skel root-channel 0))) @@ -1483,7 +1488,11 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self hit?) #f) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1622,7 +1631,10 @@ :event mother-spider-default-event-handler :enter - (behavior () (set! (-> self hit?) #f) (none)) + (behavior () + (set! (-> self hit?) #f) + (none) + ) :trans (behavior () (if (-> self hit?) @@ -1724,7 +1736,10 @@ (none) ) :trans - (behavior () (TODO-RENAME-29 self #f #f) (none)) + (behavior () + (TODO-RENAME-29 self #f #f) + (none) + ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1763,7 +1778,10 @@ :event mother-spider-death-event-handler :trans - (behavior () (TODO-RENAME-29 self #f #f) (none)) + (behavior () + (TODO-RENAME-29 self #f #f) + (none) + ) :code (behavior () (let ((v1-2 (-> self entity extra perm))) @@ -1898,14 +1916,12 @@ ;; definition for method 12 of type mother-spider (defmethod run-logic? mother-spider ((obj mother-spider)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (< (vector-vector-xz-distance (-> obj root-override trans) (math-camera-pos)) (-> obj deactivate-xz-dist)) - (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) - (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status drwf04))) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (< (vector-vector-xz-distance (-> obj root-override trans) (math-camera-pos)) (-> obj deactivate-xz-dist)) + (and (nonzero? (-> obj skel)) (!= (-> obj skel root-channel 0) (-> obj skel channel))) + (and (nonzero? (-> obj draw)) (logtest? (-> obj draw status) (draw-status drwf04))) + ) ) - ) ) ;; definition for method 7 of type mother-spider diff --git a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc index d2c25ec530..765ee14b98 100644 --- a/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc +++ b/test/decompiler/reference/levels/maincave/spiderwebs_REF.gc @@ -84,23 +84,20 @@ (let* ((a0-8 (target-pos 0)) (f1-1 (- (-> a0-8 y) (-> self root trans y))) ) - (if (and - (>= 2048.0 (fabs f1-1)) - (and - (>= 13516.8 (vector-vector-distance a0-8 (-> self root trans))) - (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) - ) - ) + (if (and (>= 2048.0 (fabs f1-1)) + (and (>= 13516.8 (vector-vector-distance a0-8 (-> self root trans))) + (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) + ) + ) (go spiderwebs-bounce) ) ) ) ) (('attack) - (if (and - (= (-> arg3 param 1) 'flop) - (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) - ) + (if (and (= (-> arg3 param 1) 'flop) + (send-event arg0 'jump (-> self spring-height) (-> self spring-height) *spider-jump-mods*) + ) (go spiderwebs-bounce) ) #f diff --git a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc index daa27af230..445ce8ea4f 100644 --- a/test/decompiler/reference/levels/misty/balloonlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/balloonlurker_REF.gc @@ -625,10 +625,10 @@ (f0-0 (vector-vector-xz-distance (-> obj dest-point-old) (-> obj root-overlay trans))) (f0-6 (/ (- (+ (/ (+ (* f30-0 (-> obj dest-point-old y)) (* f0-0 (-> obj dest-point y))) (fmax 409.6 (+ f30-0 f0-0))) - (-> *BALLOONLURKER-bank* buoyancy-depth-offset) - ) - (-> s1-0 world-pos y) - ) + (-> *BALLOONLURKER-bank* buoyancy-depth-offset) + ) + (-> s1-0 world-pos y) + ) (-> obj info max-buoyancy-depth) ) ) @@ -834,10 +834,9 @@ (balloonlurker-play-sounds) (when (nonzero? (-> self draw)) (cond - ((or - (logtest? (-> self draw status) (draw-status drwf04)) - (logtest? (-> self draw status) (draw-status drwf03)) - ) + ((or (logtest? (-> self draw status) (draw-status drwf04)) + (logtest? (-> self draw status) (draw-status drwf03)) + ) (logclear! (-> self draw status) (draw-status drwf05)) (dummy-47 (-> self root-overlay)) (ja-post) @@ -867,8 +866,8 @@ :code (behavior () (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 4) ) ) @@ -998,10 +997,9 @@ (set! (-> a0-8 param 0) 1.0) (joint-control-channel-group-eval! a0-8 (the-as art-joint-anim #f) num-func-loop!) ) - (set! v1-27 (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 9000) - (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) - ) + (set! v1-27 (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) 9000) + (< 819200.0 (- (-> self root-overlay trans y) (-> self water-y))) + ) ) ) (dummy-18 self) @@ -1327,10 +1325,9 @@ (process-drawable-from-entity! obj arg0) (TODO-RENAME-31 obj) (cond - ((logtest? - (-> (entity-actor-lookup (-> obj entity) 'alt-actor 0) extra perm status) - (entity-perm-status complete) - ) + ((logtest? (-> (entity-actor-lookup (-> obj entity) 'alt-actor 0) extra perm status) + (entity-perm-status complete) + ) (process-entity-status! obj (entity-perm-status dead) #t) (return #f) ) diff --git a/test/decompiler/reference/levels/misty/bonelurker_REF.gc b/test/decompiler/reference/levels/misty/bonelurker_REF.gc index f3bf8320b4..42272344d5 100644 --- a/test/decompiler/reference/levels/misty/bonelurker_REF.gc +++ b/test/decompiler/reference/levels/misty/bonelurker_REF.gc @@ -105,21 +105,20 @@ (go bonelurker-stun) #t ) - ((and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg1 param 0)) - (-> obj collide-info) - (the-as uint 1) - ) - (= (-> obj skel root-channel 0) (-> obj skel channel)) - (let ((v1-30 (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - ) - ) - (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) - ) - ) + ((and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg1 param 0)) + (-> obj collide-info) + (the-as uint 1) + ) + (= (-> obj skel root-channel 0) (-> obj skel channel)) + (let ((v1-30 (if (> (-> obj skel active-channels) 0) + (-> obj skel root-channel 0 frame-group) + ) + ) + ) + (or (= v1-30 (-> obj draw art-group data 9)) (= v1-30 (-> obj draw art-group data 10))) + ) + ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) pp) (set! (-> a1-6 num-params) 2) @@ -192,7 +191,10 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :exit - (behavior () (bonelurker-set-large-bounds-sphere) (none)) + (behavior () + (bonelurker-set-large-bounds-sphere) + (none) + ) :code (behavior () (bonelurker-set-small-bounds-sphere) @@ -240,10 +242,9 @@ nav-enemy-default-event-handler :trans (behavior () ((-> (method-of-type nav-enemy nav-enemy-chase) trans)) - (if (and - (zero? (logand (-> self nav-enemy-flags) 64)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self bump-player-time))) 150) - ) + (if (and (zero? (logand (-> self nav-enemy-flags) 64)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self bump-player-time))) 150) + ) (logior! (-> self nav-enemy-flags) 64) ) (none) @@ -256,15 +257,15 @@ nav-enemy-default-event-handler (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 13) ) (ja-channel-push! 1 90) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 15) ) (ja-channel-push! 1 60) @@ -309,10 +310,9 @@ nav-enemy-default-event-handler ) (while #t (cond - ((or - (not *target*) - (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) - ) + ((or (not *target*) + (< 36864.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) + ) (let ((a0-19 (-> self skel root-channel 0))) (set! (-> a0-19 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) (set! (-> a0-19 param 0) @@ -524,8 +524,8 @@ nav-enemy-default-event-handler (s5-0 (target-pos 0)) ) (when (< (fabs - (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) - ) + (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) + ) 12743.111 ) (let ((a0-6 (-> self skel root-channel 0))) @@ -628,9 +628,15 @@ nav-enemy-default-event-handler :event bonelurker-stunned-event-handler :enter - (behavior () (nav-enemy-neck-control-inactive) (none)) + (behavior () + (nav-enemy-neck-control-inactive) + (none) + ) :exit - (behavior () (nav-enemy-neck-control-look-at) (none)) + (behavior () + (nav-enemy-neck-control-look-at) + (none) + ) :code (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) diff --git a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc index 57bde3a402..f06d9a446d 100644 --- a/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-conveyor_REF.gc @@ -234,12 +234,13 @@ ;; failed to figure out what this is: (defstate keg-on-paddle (keg) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('detach) - (go keg-paddle-to-path) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('detach) + (go keg-paddle-to-path) + ) + ) + ) :code (behavior () (set! (-> (the-as keg (-> self parent 0)) sync-offset) (the-as float (process->ppointer self))) @@ -486,7 +487,11 @@ :event (the-as (function process int symbol event-message-block object :behavior keg) #f) :code - (behavior () (sound-stop (-> self sound-id)) (dummy-18 self) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (dummy-18 self) + (none) + ) :post (the-as (function none :behavior keg) transform-post) ) @@ -606,10 +611,9 @@ ) (while #t (let ((s4-0 #f)) - (when (or - (not *target*) - (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (or (not *target*) + (< 102400.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (let ((v1-10 (-> *keg-conveyor-keg-spawn-table* gp-0))) (cond ((zero? v1-10) @@ -637,12 +641,12 @@ ) ) (set! (-> a0-6 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/misty/misty-obs_REF.gc b/test/decompiler/reference/levels/misty/misty-obs_REF.gc index 8c94578959..a731269fc8 100644 --- a/test/decompiler/reference/levels/misty/misty-obs_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-obs_REF.gc @@ -1282,12 +1282,12 @@ (f28-0 (the float s4-0)) ) (set! s4-0 (/ (the int (* 65536.0 (ja-frame-num 0))) (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1628,12 +1628,12 @@ num-func-identity ) (set! (-> gp-2 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -2105,7 +2105,10 @@ (defstate rigid-body-platform-idle (bone-platform) :virtual #t :enter - (behavior () (ja-channel-set! 0) (none)) + (behavior () + (ja-channel-set! 0) + (none) + ) :code (behavior () (while #t @@ -2512,7 +2515,10 @@ ;; failed to figure out what this is: (defstate boat-fuelcell-die (boat-fuelcell) :code - (behavior () (dummy-18 self) (none)) + (behavior () + (dummy-18 self) + (none) + ) ) ;; definition for method 11 of type boat-fuelcell diff --git a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc index 54b9254e21..8f353f2ed8 100644 --- a/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-teetertotter_REF.gc @@ -97,14 +97,13 @@ :event (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (the-as object (when (= arg2 'touch) - (when (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 1) - ) - (-> self rock-is-dangerous) - ) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + (-> self rock-is-dangerous) + ) (let ((a1-2 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-2 from) self) (set! (-> a1-2 num-params) 2) @@ -117,16 +116,15 @@ (send-event-function arg0 a1-2) ) ) - (when (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root)) - (the-as uint 2) - ) - (target-on-end-of-teetertotter? self) - (not (-> self launched-player)) - (-> self in-launch-window) - ) + (when (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root)) + (the-as uint 2) + ) + (target-on-end-of-teetertotter? self) + (not (-> self launched-player)) + (-> self in-launch-window) + ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 2) diff --git a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc index 360a299bb2..1c78c123ed 100644 --- a/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc +++ b/test/decompiler/reference/levels/misty/misty-warehouse_REF.gc @@ -34,15 +34,16 @@ ;; failed to figure out what this is: (defstate silostep-idle (silostep) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go silostep-camera) - ) - (('trigger-rise) - (go silostep-rise #f) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go silostep-camera) + ) + (('trigger-rise) + (go silostep-rise #f) + ) + ) + ) :code (behavior () (let ((gp-0 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/misty/muse_REF.gc b/test/decompiler/reference/levels/misty/muse_REF.gc index 9560552433..63ac3a1410 100644 --- a/test/decompiler/reference/levels/misty/muse_REF.gc +++ b/test/decompiler/reference/levels/misty/muse_REF.gc @@ -249,8 +249,8 @@ nav-enemy-default-event-handler :code (behavior () (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 4) ) (ja-channel-push! 1 30) @@ -313,25 +313,26 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (cond - ((or - (not *target*) - (< 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) - ) + ((or (not *target*) + (< 102400.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) + ) (set! (-> self target-speed) 0.0) (if (= (-> self momentum-speed) 0.0) (go muse-idle) ) ) - ((or - (not *target*) - (< (-> self sprint-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) + ((or (not *target*) + (< (-> self sprint-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) (set! (-> self target-speed) 40960.0) ) (else @@ -348,8 +349,8 @@ nav-enemy-default-event-handler (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 3) ) (ja-channel-push! 1 30) @@ -477,7 +478,10 @@ nav-enemy-default-event-handler :event (the-as (function process int symbol event-message-block object :behavior muse) #f) :trans - (behavior () (spool-push *art-control* (-> self anim name) 0 self -1.0) (none)) + (behavior () + (spool-push *art-control* (-> self anim name) 0 self -1.0) + (none) + ) :code (behavior () (sound-play-by-name (static-sound-name "money-pickup") (new-sound-id) 1024 0 0 1 #t) @@ -578,7 +582,13 @@ nav-enemy-default-event-handler (none) ) :post - (behavior () (dummy-51 self) (level-hint-surpress!) (kill-current-level-hint '() '() 'exit) (ja-post) (none)) + (behavior () + (dummy-51 self) + (level-hint-surpress!) + (kill-current-level-hint '() '() 'exit) + (ja-post) + (none) + ) ) ;; definition for symbol *muse-nav-enemy-info*, type nav-enemy-info diff --git a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc index c13ddc445a..300e3418ff 100644 --- a/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc +++ b/test/decompiler/reference/levels/misty/quicksandlurker_REF.gc @@ -417,7 +417,10 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) 1200) @@ -426,8 +429,7 @@ (-> self root-override transv) (-> self root-override root-prim collide-with) ) - (if (or - (logtest? (-> self root-override status) 8) + (if (or (logtest? (-> self root-override status) 8) (< (vector-vector-distance (-> self root-override trans) (the-as vector (-> self root-override trans-old))) 40.96 ) @@ -450,7 +452,10 @@ (none) ) :post - (behavior () (dummy-47 (-> self root-override)) (none)) + (behavior () + (dummy-47 (-> self root-override)) + (none) + ) ) ;; failed to figure out what this is: @@ -690,10 +695,9 @@ ;; INFO: Return type mismatch object vs none. (defbehavior quicksandlurker-check-hide-transition quicksandlurker () (when *target* - (if (and - (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (!= (-> *target* next-state name) 'target-flop) - ) + (if (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (!= (-> *target* next-state name) 'target-flop) + ) (go quicksandlurker-hide) ) 0.0 @@ -717,15 +721,20 @@ :event (the-as (function process int symbol event-message-block object :behavior quicksandlurker) #f) :enter - (behavior () (logior! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logior! (-> self draw status) (draw-status drwf01)) + (none) + ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :trans (behavior () - (if (and - *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (go quicksandlurker-wait) ) (none) @@ -752,10 +761,9 @@ (set! (-> self y-offset) 1228.8) (go quicksandlurker-track) ) - ((or - (not *target*) - (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + ((or (not *target*) + (< 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (set! (-> self y-offset) (seek (-> self y-offset) -6553.6 (* 20480.0 (-> *display* seconds-per-frame)))) (if (= (-> self y-offset) -6553.6) (go quicksandlurker-idle) @@ -870,8 +878,7 @@ quicksandlurker-default-event-handler :trans (behavior () - (if (or - (not *target*) + (if (or (not *target*) (< 81920.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) (go quicksandlurker-wait) @@ -1057,9 +1064,15 @@ :event quicksandlurker-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :exit - (behavior () (restore-collide-with-as (-> self root-override)) (none)) + (behavior () + (restore-collide-with-as (-> self root-override)) + (none) + ) :trans (behavior () (if (not *target*) @@ -1069,12 +1082,11 @@ (a1-0 (-> *target* control trans)) ) (cond - ((or - (if (dummy-16 a0-0 a1-0) - #t - ) - (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - ) + ((or (if (dummy-16 a0-0 a1-0) + #t + ) + (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + ) (set! (-> self state-time) (-> *display* base-frame-counter)) ) (else diff --git a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc index 7956ac7bd6..6dfbca0f1b 100644 --- a/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc +++ b/test/decompiler/reference/levels/ogre/flying-lurker_REF.gc @@ -349,7 +349,13 @@ ;; failed to figure out what this is: (defstate plunger-lurker-die (plunger-lurker) :code - (behavior () (dummy-18 self) (deactivate self) (suspend) 0 (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (suspend) + 0 + (none) + ) ) ;; definition for method 11 of type plunger-lurker @@ -459,10 +465,9 @@ (s4-0 #f) ) (when (-> obj draw shadow) - (when (or - (logtest? (-> obj draw status) (draw-status drwf03)) - (< (vector-vector-xz-distance-squared (-> obj root trans) (camera-pos)) 10485760000.0) - ) + (when (or (logtest? (-> obj draw status) (draw-status drwf03)) + (< (vector-vector-xz-distance-squared (-> obj root trans) (camera-pos)) 10485760000.0) + ) (let ((s3-1 (new 'stack-no-clear 'collide-tri-result)) (a1-1 (new 'stack-no-clear 'vector)) (a2-0 (new 'stack-no-clear 'vector)) @@ -472,10 +477,9 @@ (set-vector! a2-0 0.0 -81920.0 0.0 1.0) (when (>= (dummy-10 *collide-cache* a1-1 a2-0 8192.0 1 pp s3-1 1) 0.0) (set! (-> s3-1 intersect w) 8192.0) - (when (and - (sphere-in-view-frustum? (the-as sphere (-> s3-1 intersect))) - (< 822083600.0 (vector-vector-distance-squared (-> s3-1 intersect) (camera-pos))) - ) + (when (and (sphere-in-view-frustum? (the-as sphere (-> s3-1 intersect))) + (< 822083600.0 (vector-vector-distance-squared (-> s3-1 intersect) (camera-pos))) + ) (set! s4-0 #t) (let ((v1-17 s5-0)) (set! (-> v1-17 settings flags) (logand -33 (-> v1-17 settings flags))) @@ -549,7 +553,11 @@ ;; failed to figure out what this is: (defstate flying-lurker-die (flying-lurker) :code - (behavior () (dummy-18 self) (deactivate self) (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (none) + ) ) ;; failed to figure out what this is: @@ -593,9 +601,9 @@ 0.0 (let* ((f1-6 (* -81920.0 (the float (-> self rank)))) (f0-10 (+ (if (< f26-0 f0-6) - (fmax (+ -81920.0 f1-6) (- f26-0 f0-6)) - (fmin (+ 245760.0 f1-6) (- f26-0 f0-6)) - ) + (fmax (+ -81920.0 f1-6) (- f26-0 f0-6)) + (fmin (+ 245760.0 f1-6) (- f26-0 f0-6)) + ) f28-0 ) ) @@ -615,14 +623,13 @@ ;; definition for function flying-lurker-move ;; INFO: Return type mismatch float vs none. (defbehavior flying-lurker-move flying-lurker () - (+! - (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) - (path-distance (-> self path)) - ) - ) + (+! (-> self curve-position) + (/ (the float + (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) + ) + (path-distance (-> self path)) + ) + ) (set! (-> self curve-position) (fmin 1.0 (fmax 0.0 (-> self curve-position)))) (eval-path-curve! (-> self path) (-> self root trans) (-> self curve-position) 'interp) (cond @@ -818,13 +825,11 @@ (flying-lurker-calc-speed (meters 15.0) (meters 30.0) (meters 0.11666667) (meters 0.083333336)) (flying-lurker-move) (flying-lurker-rotate) - (when (and - (-> self alt-actor) - (or - (< (vector-vector-distance-squared (-> self root trans) (-> self alt-actor extra trans)) 6710886400.0) - (and *target* (< 4194304000000.0 (vector-vector-distance-squared (-> self root trans) (target-pos 0)))) - ) - ) + (when (and (-> self alt-actor) + (or (< (vector-vector-distance-squared (-> self root trans) (-> self alt-actor extra trans)) 6710886400.0) + (and *target* (< 4194304000000.0 (vector-vector-distance-squared (-> self root trans) (target-pos 0)))) + ) + ) (dummy-30 (-> self alt-actor) (entity-perm-status dead) #f) (entity-birth-no-kill (-> self alt-actor)) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) @@ -850,8 +855,8 @@ (behavior () (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 5) ) ) @@ -993,23 +998,21 @@ (defbehavior flying-lurker-play-intro flying-lurker () (logclear! (-> self mask) (process-mask actor-pause)) (close-specific-task! (game-task plunger-lurker-hit) (task-status unknown)) - (while (and - *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) (suspend) ) (while (not (process-grab? *target*)) (suspend) ) (kill-current-level-hint '(notice) '() 'exit) - (while (or - (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (!= (-> *level* loading-level) (-> *level* level-default)) - ) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (!= (-> *level* loading-level) (-> *level* level-default)) + ) (suspend) ) (suspend) @@ -1110,7 +1113,10 @@ :event flying-lurker-handler :exit - (behavior () (clear-pending-settings-from-process *setting-control* self 'allow-progress) (none)) + (behavior () + (clear-pending-settings-from-process *setting-control* self 'allow-progress) + (none) + ) :code (behavior () (when (play-movie?) @@ -1243,9 +1249,15 @@ ) ) :exit - (behavior () (ja-channel-set! 0) (none)) + (behavior () + (ja-channel-set! 0) + (none) + ) :code - (behavior ((arg0 handle) (arg1 string)) (clone-anim arg0 3 #t arg1) (none)) + (behavior ((arg0 handle) (arg1 string)) + (clone-anim arg0 3 #t arg1) + (none) + ) ) ;; failed to figure out what this is: @@ -1317,7 +1329,10 @@ ) ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :trans (behavior () (spool-push *art-control* "flying-lurker-intro" 0 self -99.0) diff --git a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc index 4fb1dc233b..4eb7b9cd8f 100644 --- a/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc +++ b/test/decompiler/reference/levels/ogre/ogre-obs_REF.gc @@ -504,7 +504,13 @@ ) ) :code - (behavior () (transform-post) (logior! (-> self mask) (process-mask sleep)) (suspend) 0 (none)) + (behavior () + (transform-post) + (logior! (-> self mask) (process-mask sleep)) + (suspend) + 0 + (none) + ) ) ;; definition for method 11 of type tntbarrel @@ -664,10 +670,9 @@ ) ) (else - (if (and - (-> self triggered) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self delay))) - ) + (if (and (-> self triggered) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self delay))) + ) (set! (-> self active) #t) ) ) @@ -1169,16 +1174,17 @@ ;; failed to figure out what this is: (defstate ogre-bridge-idle (ogre-bridge) :exit - (behavior () (ogre-bridge-update-joints) (none)) + (behavior () + (ogre-bridge-update-joints) + (none) + ) :trans (behavior () - (if (and - (and - *target* - (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (send-event *target* 'query 'powerup 3) - ) + (if (and (and *target* + (>= 286720.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) + (send-event *target* 'query 'powerup 3) + ) (go ogre-bridge-activate) ) 0 @@ -1577,7 +1583,11 @@ ;; failed to figure out what this is: (defstate ogre-bridgeend-idle (ogre-bridgeend) :code - (behavior () (transform-post) (anim-loop) (none)) + (behavior () + (transform-post) + (anim-loop) + (none) + ) ) ;; definition for method 11 of type ogre-bridgeend @@ -1920,12 +1930,12 @@ ) ) (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc index 3a179fe905..ee4c06f544 100644 --- a/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc +++ b/test/decompiler/reference/levels/racer_common/collide-reaction-racer_REF.gc @@ -114,19 +114,17 @@ (vector-reflect-flat-above! arg2 (-> sv-88 0) sv-84) (cond ((not - (and - (>= (-> arg1 best-from-prim local-sphere w) - (vector-dot - (-> arg0 ground-poly-normal) - (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) - ) - ) - (and - (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) - (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) 90) - (zero? (logand sv-104 32)) - ) - ) + (and (>= (-> arg1 best-from-prim local-sphere w) + (vector-dot + (-> arg0 ground-poly-normal) + (vector-! (new 'stack-no-clear 'vector) (-> arg1 best-tri intersect) (-> arg0 ground-touch-point)) + ) + ) + (and (< 0.0 (vector-dot (-> arg0 ground-poly-normal) arg2)) + (< (- (-> *display* base-frame-counter) (-> arg0 unknown-dword10)) 90) + (zero? (logand sv-104 32)) + ) + ) ) ) (else diff --git a/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc b/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc index e100915023..d077eb3aba 100644 --- a/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc +++ b/test/decompiler/reference/levels/racer_common/racer-states-FIC-LAV-MIS-OGR-ROL_REF.gc @@ -90,20 +90,19 @@ :exit (behavior () (when (not - (or - (= (-> self next-state name) 'target-racing) - (= (-> self next-state name) 'target-racing-jump) - (= (-> self next-state name) 'target-racing-bounce) - (= (-> self next-state name) 'target-racing-hit) - (= (-> self next-state name) 'target-racing-death) - (= (-> self next-state name) 'target-racing-smack) - (= (-> self next-state name) 'target-racing-falling) - (= (-> self next-state name) 'target-racing-get-on) - (= (-> self next-state name) 'target-racing-get-off) - (= (-> self next-state name) 'target-racing-get-off-jump) - (= (-> self next-state name) 'target-racing-grab) - (= (-> self next-state name) 'target-racing-clone-anim) - ) + (or (= (-> self next-state name) 'target-racing) + (= (-> self next-state name) 'target-racing-jump) + (= (-> self next-state name) 'target-racing-bounce) + (= (-> self next-state name) 'target-racing-hit) + (= (-> self next-state name) 'target-racing-death) + (= (-> self next-state name) 'target-racing-smack) + (= (-> self next-state name) 'target-racing-falling) + (= (-> self next-state name) 'target-racing-get-on) + (= (-> self next-state name) 'target-racing-get-off) + (= (-> self next-state name) 'target-racing-get-off-jump) + (= (-> self next-state name) 'target-racing-grab) + (= (-> self next-state name) 'target-racing-clone-anim) + ) ) (let ((v1-25 (-> self manipy))) (when v1-25 @@ -324,23 +323,21 @@ ;; INFO: Return type mismatch object vs none. ;; Used lq/sq (defbehavior target-racing-smack-check target () - (if (and - (< 20480.0 (-> self control unknown-float01)) - (and - (logtest? (-> self control status) 8) - (< (-> self control surface-angle) 0.5) - (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector70) (-> self control trans))) - (s5-0 (new 'stack-no-clear 'vector)) + (if (and (< 20480.0 (-> self control unknown-float01)) + (and (logtest? (-> self control status) 8) + (< (-> self control surface-angle) 0.5) + (let ((gp-1 (vector-! (new 'stack-no-clear 'vector) (-> self control unknown-vector70) (-> self control trans))) + (s5-0 (new 'stack-no-clear 'vector)) + ) + (set! (-> s5-0 quad) (-> self control unknown-vector10 quad)) + (set! (-> gp-1 y) 0.0) + (set! (-> s5-0 y) 0.0) + (vector-xz-normalize! gp-1 1.0) + (vector-xz-normalize! s5-0 1.0) + (< 0.87 (vector-dot gp-1 s5-0)) ) - (set! (-> s5-0 quad) (-> self control unknown-vector10 quad)) - (set! (-> gp-1 y) 0.0) - (set! (-> s5-0 y) 0.0) - (vector-xz-normalize! gp-1 1.0) - (vector-xz-normalize! s5-0 1.0) - (< 0.87 (vector-dot gp-1 s5-0)) - ) - ) - ) + ) + ) (go target-racing-smack (-> self control unknown-float01) #t) ) (none) @@ -351,32 +348,34 @@ :event (-> target-racing-start event) :enter - (behavior () (set! (-> self control unknown-surface00) *racer-mods*) (none)) + (behavior () + (set! (-> self control unknown-surface00) *racer-mods*) + (none) + ) :exit - (behavior () (target-racing-center-anim) ((-> target-racing-start exit)) (none)) + (behavior () + (target-racing-center-anim) + ((-> target-racing-start exit)) + (none) + ) :trans (behavior () - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons l1 r1) - ) - (or - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30) - (< (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30) + (< (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + ) + 4096.0 ) - 4096.0 ) - ) - ) + ) (go target-racing-jump 2048.0 5324.8 #t) ) (target-racing-smack-check) @@ -388,17 +387,15 @@ ) ) ) - (if (and - (zero? (logand (-> self control status) 1)) - (or - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) - (the-as int (* (-> *TARGET-bank* ground-timeout) 2)) - ) - (< 75 v1-28) - ) - (< 30 v1-28) - (< 4096.0 f30-0) - ) + (if (and (zero? (logand (-> self control status) 1)) + (or (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) + (the-as int (* (-> *TARGET-bank* ground-timeout) 2)) + ) + (< 75 v1-28) + ) + (< 30 v1-28) + (< 4096.0 f30-0) + ) (go target-racing-falling) ) ) @@ -410,8 +407,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 138) ) (let ((a0-4 (-> self skel root-channel 0))) @@ -429,21 +426,18 @@ ) ) ) - (or - (or (= v1-16 (-> self draw art-group data 130)) (= v1-16 (-> self draw art-group data 131))) - (> (-> self racer bounce) 0) - ) + (or (or (= v1-16 (-> self draw art-group data 130)) (= v1-16 (-> self draw art-group data 131))) + (> (-> self racer bounce) 0) + ) ) (let ((s5-0 #f) (gp-0 #f) ) - (when (and - (< (fabs (-> self racer bob-mult-trans)) 0.2) - (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer racing-time))) 45) - (< 16384.0 (-> self control ground-impact-vel)) - ) - ) + (when (and (< (fabs (-> self racer bob-mult-trans)) 0.2) + (and (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer racing-time))) 45) + (< 16384.0 (-> self control ground-impact-vel)) + ) + ) (when (>= (-> self control unknown-float01) 40960.0) (set! (-> *part-id-table* 2225 init-specs 1 initial-valuef) 100.0) (sp-launch-particles-var @@ -509,8 +503,8 @@ (while #t (let ((gp-3 (-> *display* base-frame-counter))) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 123) ) ) @@ -552,15 +546,12 @@ ) ) (while (< (- (-> *display* base-frame-counter) gp-3) 300) - (if (or - (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (or - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1 x) + (if (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (or (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1 x) + ) + (>= (fabs (-> self racer turn-anim-frame)) 1.0) ) - (>= (fabs (-> self racer turn-anim-frame)) 1.0) - ) ) (set! gp-3 (-> *display* base-frame-counter)) ) @@ -569,8 +560,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 133) ) ) @@ -584,16 +575,13 @@ (set! (-> gp-4 frame-num) 0.0) ) ) - (while (not (or - (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) - (or - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1 x) - ) - (>= (fabs (-> self racer turn-anim-frame)) 1.0) + (while (not (or (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) + (or (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1 x) + ) + (>= (fabs (-> self racer turn-anim-frame)) 1.0) + ) ) - ) ) (suspend) (let ((a0-54 (-> self skel root-channel 0))) @@ -643,10 +631,9 @@ ) (if (< (-> self racer slide-mode) 0) (set! (-> self racer slide-down-time 0) - (the-as uint (if (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) + (the-as uint (if (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) (-> *display* base-frame-counter) 0 ) @@ -673,10 +660,9 @@ ) ) (cond - ((logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons l1 r1) - ) + ((logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons l1 r1) + ) (set! (-> self racer slide-down-time 0) (the-as uint (-> *display* base-frame-counter))) ) ((zero? @@ -685,16 +671,14 @@ (set! (-> self racer slide-down-time 0) (the-as uint 0)) 0 ) - ((and - (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer slide-down-time 0))) - (the-as int (-> *RACER-bank* slide-hold-time)) - ) - (< (-> self racer slide-mode) 0) - (or - (< (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx) (the-as uint 64)) - (< (the-as uint 192) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx)) - ) - ) + ((and (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer slide-down-time 0))) + (the-as int (-> *RACER-bank* slide-hold-time)) + ) + (< (-> self racer slide-mode) 0) + (or (< (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx) (the-as uint 64)) + (< (the-as uint 192) (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx)) + ) + ) (set! (-> self racer slide-mode) (if (< (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) leftx) (the-as uint 64)) 0 @@ -720,8 +704,7 @@ (if (and (logtest? (-> self control status) 1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30)) (go target-racing) ) - (if (or - (< (-> self control trans y) (-> self racer hop-start-y)) + (if (or (< (-> self control trans y) (-> self racer hop-start-y)) (< 10240.0 (vector-dot (-> self control dynam gravity-normal) (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) @@ -737,10 +720,9 @@ (mod-var-jump #t #t - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) (-> self control transv) ) (set! (-> self racer shock-offset) (* 0.8 (-> self racer shock-offset))) @@ -795,27 +777,22 @@ (* 0.003921569 (the float (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 6))) ) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons l1 r1) - ) - (or - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60) - (< (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60) + (< (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) + ) + 8192.0 ) - 8192.0 ) - ) - ) + ) (go target-racing-jump 2048.0 5324.8 #t) ) (if (and (logtest? (-> self control status) 1) (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30)) @@ -824,10 +801,9 @@ (mod-var-jump #t #t - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) (-> self control transv) ) (target-racing-smack-check) @@ -838,8 +814,8 @@ (behavior ((arg0 float) (arg1 float) (arg2 symbol)) (target-racing-land-anim arg2) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 123) ) ) @@ -915,9 +891,16 @@ (none) ) :exit - (behavior () (set! (-> self racer heavy) #f) ((-> target-racing-start exit)) (none)) + (behavior () + (set! (-> self racer heavy) #f) + ((-> target-racing-start exit)) + (none) + ) :trans - (behavior () (set! (-> self racer turn-anim-targ) 0.0) (none)) + (behavior () + (set! (-> self racer turn-anim-targ) 0.0) + (none) + ) :code (behavior ((arg0 float) (arg1 symbol)) (sound-play-by-name (static-sound-name "zoomer-crash-2") (new-sound-id) 1024 0 0 1 #t) @@ -985,7 +968,10 @@ (none) ) :code - (behavior () (target-racing-jump-anim #f 30) (none)) + (behavior () + (target-racing-jump-anim #f 30) + (none) + ) :post (-> target-racing post) ) @@ -1338,10 +1324,9 @@ (set! (-> self state-time) (-> *display* base-frame-counter)) (until v1-154 (suspend) - (set! v1-154 (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) - (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) - ) + (set! v1-154 (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) + (zero? (logand (-> *kernel-context* prevent-from-run) (process-mask movie))) + ) ) ) (go target-stance) @@ -1442,11 +1427,10 @@ (rot->dir-targ! (-> self control)) (set! (-> self racer rot y) (y-angle (-> self control))) (when *target* - (when (or - (= (-> *target* current-level name) 'lavatube) - (= (-> *target* current-level name) 'firecanyon) - (= (-> *target* current-level name) 'citadel) - ) + (when (or (= (-> *target* current-level name) 'lavatube) + (= (-> *target* current-level name) 'firecanyon) + (= (-> *target* current-level name) 'citadel) + ) (let ((gp-3 (get-process *default-dead-pool* hud-bike-heat #x4000))) (set! (-> *hud-parts* bike-heat) (the-as @@ -1554,8 +1538,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 123) ) ) @@ -1711,10 +1695,9 @@ ) ) ) - (when (and - (< (fabs (deg-diff (-> *RACER-bank* default-front-blade) (-> self racer front-rot))) 1820.4445) - (= (-> self racer front-rotv) 5461.3335) - ) + (when (and (< (fabs (deg-diff (-> *RACER-bank* default-front-blade) (-> self racer front-rot))) 1820.4445) + (= (-> self racer front-rotv) 5461.3335) + ) (set! (-> self racer front-rotv) 0.0) (set! (-> self racer front-rot) (-> *RACER-bank* default-front-blade)) ) @@ -1771,7 +1754,11 @@ :enter (-> target-hit-ground enter) :trans - (behavior () (logior! (-> self control status) 7) ((-> target-hit-ground trans)) (none)) + (behavior () + (logior! (-> self control status) 7) + ((-> target-hit-ground trans)) + (none) + ) :code (behavior ((arg0 symbol)) (ja-channel-set! 1) @@ -1796,7 +1783,11 @@ (none) ) :post - (behavior () (hide-hud) (target-post) (none)) + (behavior () + (hide-hud) + (target-post) + (none) + ) ) ;; failed to figure out what this is: @@ -1841,8 +1832,8 @@ :code (behavior () (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 123) ) ) diff --git a/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc b/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc index c8151f31b4..bb238ec262 100644 --- a/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc +++ b/test/decompiler/reference/levels/racer_common/target-racer-FIC-LAV-MIS-OGR-ROL_REF.gc @@ -130,15 +130,15 @@ (cond ((zero? v1-1) (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) ((= v1-1 1) (if (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) - ) + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons l1 r1)) + ) (set! (-> self racer slide-mode) -1) ) ) @@ -213,11 +213,10 @@ (meters 0.000061035156) (new 'static 'rgba :r #xff :a #x80) ) - (if (and - (< 409.6 (vector-xz-length (-> self control unknown-vector00))) - s5-1 - (= (-> self next-state name) 'target-racing) - ) + (if (and (< 409.6 (vector-xz-length (-> self control unknown-vector00))) + s5-1 + (= (-> self next-state name) 'target-racing) + ) (vector-rotate-y! (-> self control unknown-vector00) (-> self control unknown-vector00) @@ -270,11 +269,10 @@ ;; INFO: Return type mismatch int vs none. (defbehavior racer-thrust target ((arg0 basic) (arg1 float)) (let ((f0-0 - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - (not (-> self racer stick-lock)) - (not (-> self racer stick-off)) - ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (not (-> self racer stick-lock)) + (not (-> self racer stick-off)) + ) 1.0 0.0 ) @@ -314,29 +312,25 @@ ) (set! f0-13 (cond - ((and - (not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))) - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons square) - ) - ) - (if (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - (not (-> self racer stick-lock)) - (not (-> self racer stick-off)) - ) + ((and (not (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0))) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons square) + ) + ) + (if (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (not (-> self racer stick-lock)) + (not (-> self racer stick-off)) + ) (* 0.9875 f0-13) (* 0.49375 (+ 1.0 f0-13)) ) ) (else (cond - ((and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) - (not (-> self racer stick-lock)) - (not (-> self racer stick-off)) - ) + ((and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (not (-> self racer stick-lock)) + (not (-> self racer stick-off)) + ) ) (else (set! f0-13 (* 0.5 (+ 1.0 f0-13))) @@ -354,10 +348,9 @@ (vector-xz-normalize! (-> self control unknown-vector00) f30-0) ) ) - (+! - (-> self racer bottom-rot) - (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame)) - ) + (+! (-> self racer bottom-rot) + (* (+ 364088.88 (* 0.32 (fabs (-> self control unknown-vector00 y)))) (-> *display* seconds-per-frame)) + ) 0 (none) ) @@ -434,23 +427,20 @@ (let ((f30-0 0.8)) (dummy-33 (-> self control) (-> self control transv) (-> self control root-prim collide-with)) (+! (-> self racer shock-offsetv) (* (- (-> gp-0 y) (-> self control transv y)) f30-0)) - (+! - (-> self racer shock-offsetv) - (+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset)) - (if (racer-on-ground?) - (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0) - 0.0 - ) - ) - ) + (+! (-> self racer shock-offsetv) + (+ (* -20.0 (-> *display* seconds-per-frame) (-> self racer shock-offset)) + (if (racer-on-ground?) + (* (-> self control dynam gravity-length) (-> *display* seconds-per-frame) f30-0) + 0.0 + ) + ) + ) ) - (if (and - (or - (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60) - (< (-> self racer shock-offset) 0.0) - ) - (!= (-> self control unknown-surface00 mode) 'air) - ) + (if (and (or (< (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 60) + (< (-> self racer shock-offset) 0.0) + ) + (!= (-> self control unknown-surface00 mode) 'air) + ) (+! (-> self racer shock-offset) (* (-> self racer shock-offsetv) (-> *display* seconds-per-frame))) ) (set! (-> self racer shock-offset) @@ -478,11 +468,10 @@ ) (deg-diff (vector-y-angle gp-0) (vector-y-angle (-> self control transv))) (let ((f30-2 (vector-xz-length gp-0))) - (when (and - (logtest? (-> self control status) 8) - (< 20480.0 f30-2) - (and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack)) - ) + (when (and (logtest? (-> self control status) 8) + (< 20480.0 f30-2) + (and (< (fabs (-> self racer mod-x)) 0.5) (!= (-> self next-state name) 'target-racing-smack)) + ) (let ((s5-3 (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector70)))) (vector-normalize! s5-3 1.0) (let ((gp-1 (vector-reflect-flat! (new 'stack-no-clear 'vector) gp-0 s5-3))) @@ -545,13 +534,11 @@ (quaternion-copy! (-> self control quat) (-> self control unknown-quaternion00)) (set-twist! (-> self racer front-blade) (the-as float #f) (- (-> self racer front-rot)) (the-as float #f)) (set-twist! (-> self racer bottom-blade) (the-as float #f) (the-as float #f) (- (-> self racer bottom-rot))) - (if (and - (= *cheat-mode* 'debug) - (and - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - (not *pause-lock*) - ) - ) + (if (and (= *cheat-mode* 'debug) + (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + (not *pause-lock*) + ) + ) (vector-reset! (-> self control transv)) ) 0 @@ -567,8 +554,7 @@ ) ) (let ((f0-2 - (if (or - (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) + (if (or (and (logtest? (-> self control status) 8) (zero? (logand (-> self control status) 1))) (logtest? (-> self state-flags) #x8000) ) 0.0 @@ -609,11 +595,11 @@ (let ((f0-6 (+ (* 2.0 f0-1) (if (< 4096.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) - ) + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control shadow-pos)) ) + ) 0.7 0.0 ) @@ -663,10 +649,9 @@ (send-event-function self a1-6) ) ) - ((and - (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) 900) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) 300) - ) + ((and (>= (- (-> *display* base-frame-counter) (-> self racer unstuck-time)) 900) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) 300) + ) (set! (-> self racer heat-sound-time) (the-as uint (-> *display* base-frame-counter))) (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) ) @@ -781,23 +766,21 @@ ((= v1-61 (pat-material hotcoals)) (-> *part-id-table* 2214) ) - ((or - (= v1-61 (pat-material pcmetal)) - (= v1-61 (pat-material metal)) - (= v1-61 (pat-material tube)) - (= v1-61 (pat-material rotate)) - ) + ((or (= v1-61 (pat-material pcmetal)) + (= v1-61 (pat-material metal)) + (= v1-61 (pat-material tube)) + (= v1-61 (pat-material rotate)) + ) (-> *part-id-table* 2215) ) ((= v1-61 (pat-material grass)) (-> *part-id-table* 2207) ) - ((or - (= v1-61 (pat-material dirt)) - (= v1-61 (pat-material sand)) - (= v1-61 (pat-material straw)) - (= v1-61 (pat-material gravel)) - ) + ((or (= v1-61 (pat-material dirt)) + (= v1-61 (pat-material sand)) + (= v1-61 (pat-material straw)) + (= v1-61 (pat-material gravel)) + ) (-> *part-id-table* 2216) ) ((or (= v1-61 (pat-material wood)) (= v1-61 (pat-material crwood))) @@ -865,15 +848,13 @@ ) ) ) - (when (and - (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (pad-buttons circle square) - ) - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) - (zero? (logand (-> self state-flags) #x8008)) - ) + (when (and (and (= (-> self fact-info-target eco-type) 1) (>= (-> self fact-info-target eco-level) 1.0)) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (pad-buttons circle square) + ) + (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword82)) 75) + (zero? (logand (-> self state-flags) #x8008)) + ) (let ((gp-6 (vector-z-quaternion! (new 'stack-no-clear 'vector) (-> self control quat))) (s5-4 (vector<-cspace! (new 'stack-no-clear 'vector) (-> self manipy 0 node-list data 4))) ) @@ -977,13 +958,12 @@ (set! (-> self racer boost-curve) 0.0) ) ) - (when (or - (zero? - (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + (when (or (zero? + (logand (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons x)) + ) + (< (-> self control unknown-float01) 4096.0) + (= (-> self racer boost-level) 0.0) ) - (< (-> self control unknown-float01) 4096.0) - (= (-> self racer boost-level) 0.0) - ) (when (nonzero? (-> self racer boost-sound-id)) (let ((v1-241 (the-as sound-rpc-set-param (get-sound-buffer-entry)))) (set! (-> v1-241 command) (sound-command set-param)) @@ -1058,15 +1038,13 @@ #t ) ) - (when (and - (< (-> self racer heat) (-> *RACER-bank* heat-max)) - (and - (< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) - (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) - ) - ) - ) + (when (and (< (-> self racer heat) (-> *RACER-bank* heat-max)) + (and (< (* 0.8 (-> *RACER-bank* heat-max)) (-> self racer heat)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self racer heat-sound-time))) + (the int (* 3000.0 (- 1.0 (/ (-> self racer heat) (-> *RACER-bank* heat-max))))) + ) + ) + ) (set! (-> self racer heat-sound-time) (the-as uint (-> *display* base-frame-counter))) (sound-play-by-name (static-sound-name "warning") (new-sound-id) 1024 0 0 1 #t) ) @@ -1110,26 +1088,24 @@ (countdown (s5-0 gp-0) (set! (-> self control unknown-int40) s5-0) (set! (-> self racer turn-anim-targ) (fmax -16.0 (fmin 16.0 (-> self racer turn-anim-targ)))) - (or - (not (>= (* (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) 0.0)) - (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ))) - ) - (+! - (-> self racer turn-anim-vel) - (* (- (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) - (lerp-scale - 20.0 - (if (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ))) - 30.0 - 60.0 - ) - (-> self control unknown-float01) - 0.0 - (* 0.3 (-> self racer transv-max)) + (or (not (>= (* (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) 0.0)) + (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ))) + ) + (+! (-> self racer turn-anim-vel) + (* (- (-> self racer turn-anim-targ) (-> self racer turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self racer turn-anim-frame)) (fabs (-> self racer turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control unknown-float01) + 0.0 + (* 0.3 (-> self racer transv-max)) + ) + (-> *display* seconds-per-frame) ) - (-> *display* seconds-per-frame) - ) - ) + ) (set! (-> self racer turn-anim-vel) (fmax -100.0 @@ -1151,15 +1127,14 @@ (set! (-> self racer turn-anim-vel) 0.0) ) ) - (+! - (-> self racer tail-anim-vel) - (* -50.0 - (-> *display* seconds-per-frame) - (- (-> self racer tail-anim-frame) - (* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old))) - ) - ) - ) + (+! (-> self racer tail-anim-vel) + (* -50.0 + (-> *display* seconds-per-frame) + (- (-> self racer tail-anim-frame) + (* -0.0091552725 (- (-> self racer change-roty) (-> self racer change-roty-old))) + ) + ) + ) (set! (-> self racer tail-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.8 (-> self racer tail-anim-vel))))) (+! (-> self racer tail-anim-frame) (* (-> self racer tail-anim-vel) (-> *display* seconds-per-frame))) (set! (-> self racer tail-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer tail-anim-frame)))) @@ -1171,10 +1146,9 @@ (set! (-> self racer tail-anim-vel) 0.0) ) ) - (+! - (-> self racer rudd-anim-vel) - (* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) - ) + (+! (-> self racer rudd-anim-vel) + (* 40.0 (-> *display* seconds-per-frame) (- (-> self racer tail-anim-frame) (-> self racer rudd-anim-frame))) + ) (set! (-> self racer rudd-anim-vel) (fmax -100.0 (fmin 100.0 (* 0.96 (-> self racer rudd-anim-vel))))) (+! (-> self racer rudd-anim-frame) (* (-> self racer rudd-anim-vel) (-> *display* seconds-per-frame))) (set! (-> self racer rudd-anim-frame) (fmax -20.0 (fmin 20.0 (-> self racer rudd-anim-frame)))) @@ -1421,21 +1395,21 @@ (cond ((zero? v1-17) (- (fmax - (analog-input - (the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 8)) - 0.0 - 32.0 - 255.0 - 1.0 - ) - (analog-input - (the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 9)) - 0.0 - 32.0 - 255.0 - 1.0 - ) - ) + (analog-input + (the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 8)) + 0.0 + 32.0 + 255.0 + 1.0 + ) + (analog-input + (the-as int (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) abutton 9)) + 0.0 + 32.0 + 255.0 + 1.0 + ) + ) ) ) ((= v1-17 1) @@ -1479,15 +1453,15 @@ ) (f1-3 (* -0.8 (-> self racer rotv y))) (f0-33 (+ (cond - ((< (* f1-3 f26-3) 0.0) - 0.0 - ) - (else - (let ((f2-3 (+ 910.2222 (fabs f1-3)))) - (fmax (fmin f26-3 f2-3) (- f2-3)) - ) - ) + ((< (* f1-3 f26-3) 0.0) + 0.0 ) + (else + (let ((f2-3 (+ 910.2222 (fabs f1-3)))) + (fmax (fmin f26-3 f2-3) (- f2-3)) + ) + ) + ) (cond ((< (* f1-3 f0-29) 0.0) 0.0 @@ -1590,10 +1564,9 @@ (cond ((>= f0-77 -32768.0) (cond - ((or - (= (-> self next-state name) 'target-racing-jump) - (and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1)) - ) + ((or (= (-> self next-state name) 'target-racing-jump) + (and (= (-> self next-state name) 'target-racing-bounce) (= (-> self racer bounce) 1)) + ) (set! (-> self racer speed-rotx) 0.5) (when (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30) (set! (-> self racer hill-rotx) @@ -1636,29 +1609,25 @@ ) ) (cond - ((and - (logtest? (-> self control status) 8) - (and - (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30) - (or (-> self racer stick-lock) (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0)) - (not - (and - (= *cheat-mode* 'debug) - (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) - ) - ) - ) - ) - (cond - ((and - (< 0.0 - (vector-dot - (-> self control dynam gravity-normal) - (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector54)) + ((and (logtest? (-> self control status) 8) + (and (>= (- (-> *display* base-frame-counter) (-> self control unknown-dword11)) 30) + (or (-> self racer stick-lock) (< (target-move-dist (the-as int (-> *TARGET-bank* stuck-time))) 4096.0)) + (not + (and (= *cheat-mode* 'debug) + (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) (pad-buttons r2)) + ) + ) ) - ) - (logtest? (-> self control root-prim prim-core action) #x8000) ) + (cond + ((and (< 0.0 + (vector-dot + (-> self control dynam gravity-normal) + (vector-! (new 'stack-no-clear 'vector) (-> self control trans) (-> self control unknown-vector54)) + ) + ) + (logtest? (-> self control root-prim prim-core action) #x8000) + ) (+! (-> self racer stuck-count) 1) (go target-racing-smack 122880.0 #f) ) diff --git a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc index e1b16366b2..09c33fa508 100644 --- a/test/decompiler/reference/levels/robocave/cave-trap_REF.gc +++ b/test/decompiler/reference/levels/robocave/cave-trap_REF.gc @@ -77,7 +77,12 @@ ) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; definition for method 11 of type spider-vent @@ -300,7 +305,12 @@ (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -308,7 +318,10 @@ :event cave-trap-default-event-handler :enter - (behavior () (set! (-> self spawn-delay) (the-as uint 150)) (none)) + (behavior () + (set! (-> self spawn-delay) (the-as uint 150)) + (none) + ) :trans (behavior () (cond @@ -321,12 +334,11 @@ (go cave-trap-give-up) ) ) - (if (and - (< (-> self spider-count) 8) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-spawn-time))) - (the-as int (-> self spawn-delay)) - ) - ) + (if (and (< (-> self spider-count) 8) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-spawn-time))) + (the-as int (-> self spawn-delay)) + ) + ) (TODO-RENAME-20 self) ) ) @@ -338,7 +350,12 @@ (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -346,7 +363,11 @@ :event cave-trap-default-event-handler :code - (behavior () (suspend) (go cave-trap-idle) (none)) + (behavior () + (suspend) + (go cave-trap-idle) + (none) + ) ) ;; definition for method 7 of type cave-trap diff --git a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc index 03661ec277..58f0fa3eee 100644 --- a/test/decompiler/reference/levels/robocave/spider-egg_REF.gc +++ b/test/decompiler/reference/levels/robocave/spider-egg_REF.gc @@ -68,7 +68,10 @@ ) ) :enter - (behavior ((arg0 symbol)) (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior ((arg0 symbol)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :code (behavior ((arg0 symbol)) (let ((f30-0 (rand-vu-float-range 0.8 1.2))) @@ -83,12 +86,12 @@ (set! (-> gp-1 param 1) f30-0) (set! (-> gp-1 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc index 4e2f6ec405..51a53cb8b2 100644 --- a/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-obs_REF.gc @@ -332,10 +332,9 @@ ;; definition for function dark-plant-check-target ;; INFO: Return type mismatch object vs symbol. (defun dark-plant-check-target ((arg0 dark-plant)) - (the-as symbol (and *target* (and - (< (vector-vector-distance (-> arg0 root trans) (target-pos 0)) 16384.0) - (send-event *target* 'query 'powerup 4) - ) + (the-as symbol (and *target* (and (< (vector-vector-distance (-> arg0 root trans) (target-pos 0)) 16384.0) + (send-event *target* 'query 'powerup 4) + ) ) ) ) @@ -437,10 +436,9 @@ ) (set! (-> self state-time) (-> *display* base-frame-counter)) (while #t - (when (and - (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) - (!= (get-task-status (game-task rolling-plants)) 7) - ) + (when (and (!= (get-task-status (game-task rolling-plants)) (task-status invalid)) + (!= (get-task-status (game-task rolling-plants)) 7) + ) (cond ((>= (- (-> *display* base-frame-counter) (-> self state-time)) gp-0) (go dark-plant-sprout) @@ -502,11 +500,10 @@ :code (behavior () (while #t - (when (and - (logtest? (-> self draw status) (draw-status drwf03)) - *target* - (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) - ) + (when (and (logtest? (-> self draw status) (draw-status drwf03)) + *target* + (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans))) + ) (if (rand-vu-percent? 0.3) (sound-play-by-name (static-sound-name "darkvine-move") (new-sound-id) 1024 0 0 1 #t) ) @@ -887,12 +884,12 @@ ) ) (set! (-> a0-1 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1116,12 +1113,13 @@ ;; failed to figure out what this is: (defstate rolling-start-break (rolling-start) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('unbreak) - (go rolling-start-whole) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('unbreak) + (go rolling-start-whole) + ) + ) + ) :code (behavior ((arg0 symbol)) (let ((a0-1 (-> self skel root-channel 0))) @@ -1374,12 +1372,11 @@ ) (let ((gp-0 (new-stack-vector0))) (vector-matrix*! gp-0 (target-pos 0) (-> arg0 coord)) - (and - (< (fabs (-> gp-0 x)) (-> arg0 radius)) - (< (-> gp-0 y) (-> arg0 radius)) - (< 0.0 (-> gp-0 y)) - (< (-> gp-0 z) 0.0) - ) + (and (< (fabs (-> gp-0 x)) (-> arg0 radius)) + (< (-> gp-0 y) (-> arg0 radius)) + (< 0.0 (-> gp-0 y)) + (< (-> gp-0 z) 0.0) + ) ) ) @@ -1391,13 +1388,12 @@ ) (let ((s5-0 (new-stack-vector0))) (vector-matrix*! s5-0 (target-pos 0) (-> arg0 coord)) - (and - (< (fabs (-> s5-0 x)) (-> arg0 radius)) - (< (-> s5-0 y) (-> arg0 radius)) - (< 0.0 (-> s5-0 y)) - (< 0.0 (-> s5-0 z)) - (< (-> s5-0 z) (-> arg0 thickness)) - ) + (and (< (fabs (-> s5-0 x)) (-> arg0 radius)) + (< (-> s5-0 y) (-> arg0 radius)) + (< 0.0 (-> s5-0 y)) + (< 0.0 (-> s5-0 z)) + (< (-> s5-0 z) (-> arg0 thickness)) + ) ) ) @@ -1631,7 +1627,10 @@ ;; failed to figure out what this is: (defstate gorge-start-race-finished (gorge-start) :trans - (behavior () (gorge-trans) (none)) + (behavior () + (gorge-trans) + (none) + ) :code (behavior () (gorge-start-draw-time #t #t) @@ -1659,7 +1658,10 @@ ;; failed to figure out what this is: (defstate gorge-start-race-aborted (gorge-start) :trans - (behavior () (gorge-trans) (none)) + (behavior () + (gorge-trans) + (none) + ) :code (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) @@ -1915,7 +1917,11 @@ (none) ) :trans - (behavior () (gorge-start-launch-start-banner) (gorge-trans) (none)) + (behavior () + (gorge-start-launch-start-banner) + (gorge-trans) + (none) + ) :code (behavior () (while #t diff --git a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc index e4a1f0dfb7..baa27c99e9 100644 --- a/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-race-ring_REF.gc @@ -1284,11 +1284,10 @@ (set! (-> obj cyl radius) 24576.0) (set! (-> obj cyl length) 4096.0) (cond - ((and - (first-ring? obj) - (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) - (!= (get-task-status (-> obj entity extra perm task)) 7) - ) + ((and (first-ring? obj) + (!= (get-task-status (-> obj entity extra perm task)) (task-status invalid)) + (!= (get-task-status (-> obj entity extra perm task)) 7) + ) (set! (-> obj alt-task) (res-lump-value (-> obj entity) 'alt-task uint)) (if (or (= (-> obj alt-task) 0) (= (get-task-status (the-as game-task (-> obj alt-task))) (task-status invalid))) (go race-ring-active) diff --git a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc index 838bb13f5f..37f26a9eef 100644 --- a/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc +++ b/test/decompiler/reference/levels/rolling/rolling-robber_REF.gc @@ -240,14 +240,13 @@ ;; definition for function robber-move (defbehavior robber-move robber () - (+! - (-> self curve-position) - (/ (the float - (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) - ) - (path-distance (-> self path)) - ) - ) + (+! (-> self curve-position) + (/ (the float + (* (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter)) (the int (-> self speed))) + ) + (path-distance (-> self path)) + ) + ) (cond ((< 1.0 (-> self curve-position)) (set! (-> self curve-position) (+ -1.0 (-> self curve-position))) @@ -330,12 +329,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -387,7 +386,11 @@ ;; failed to figure out what this is: (defstate robber-dead (robber) :code - (behavior () (dummy-18 self) (deactivate self) (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (none) + ) ) ;; failed to figure out what this is: @@ -488,20 +491,17 @@ robber-event-handler :trans (behavior () - (if (and - (not (and - *target* - (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) - (robber-find-ground) - ) + (if (and (not (and *target* + (>= 204800.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) + (robber-find-ground) + ) (go robber-idle) ) - (if (and - *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) (go robber-flee) ) (none) @@ -509,8 +509,8 @@ :code (behavior () (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) ) @@ -542,16 +542,21 @@ :event robber-event-handler :enter - (behavior () (set! (-> self y-offset-desired) -12288.0) (none)) + (behavior () + (set! (-> self y-offset-desired) -12288.0) + (none) + ) :exit - (behavior () (set! (-> self y-offset-desired) 0.0) (none)) + (behavior () + (set! (-> self y-offset-desired) 0.0) + (none) + ) :trans (behavior () - (if (not (and - *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) + (if (not (and *target* + (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) (go robber-got-away) ) (none) @@ -560,8 +565,8 @@ (behavior () (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) ) @@ -634,17 +639,15 @@ ) :trans (behavior () - (if (not (and - *target* - (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) - ) + (if (not (and *target* + (>= 163840.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) + ) (go robber-got-away) ) - (when (and - *target* - (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (when (and *target* + (>= 102400.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) (set! (-> self near-timer) (- (-> self near-timer) (- (-> *display* base-frame-counter) (-> *display* old-base-frame-counter))) ) @@ -662,8 +665,8 @@ (behavior () (while #t (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) ) @@ -728,13 +731,15 @@ :event robber-event-handler :enter - (behavior () (set! (-> self speed) 0.0) (none)) + (behavior () + (set! (-> self speed) 0.0) + (none) + ) :trans (behavior () - (if (and - *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) (go robber-flee) ) (robber-rotate (the-as target #t) 182.04445) @@ -776,10 +781,9 @@ :trans (behavior () (when (logtest? (-> self draw status) (draw-status drwf03)) - (if (and - *target* - (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 163840.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) (level-hint-spawn (game-text-id rolling-flying-lurker-intro) "sksp0116" @@ -789,10 +793,9 @@ ) ) ) - (if (and - *target* - (>= 32768.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 32768.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) (go robber-flee) ) (none) @@ -843,13 +846,15 @@ :event robber-event-handler :enter - (behavior () (set! (-> self speed) 0.0) (none)) + (behavior () + (set! (-> self speed) 0.0) + (none) + ) :trans (behavior () - (if (and - *target* - (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) - ) + (if (and *target* + (>= 122880.0 (vector-vector-xz-distance (-> self root-override trans) (-> *target* control trans))) + ) (go robber-initial-notice) ) (robber-move) diff --git a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc index 5f906f9fbc..ea5a8b1d28 100644 --- a/test/decompiler/reference/levels/snow/snow-bumper_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-bumper_REF.gc @@ -213,14 +213,13 @@ (('touch 'attack 'bonk) (when (= (-> arg0 type) target) (let ((gp-0 (-> arg3 param 0))) - (when (and - (>= 6144.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry gp-0) - (the-as collide-shape-moving (-> self root)) - (the-as uint 1) - ) - ) + (when (and (>= 6144.0 (vector-vector-xz-distance (-> self root trans) (target-pos 0))) + ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry gp-0) + (the-as collide-shape-moving (-> self root)) + (the-as uint 1) + ) + ) (close-specific-task! (game-task snow-bumpers) (task-status need-hint)) (go snow-bumper-deactivate) ) @@ -240,12 +239,11 @@ (if (< 368640.0 f30-0) (go snow-bumper-active-far-idle) ) - (if (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-shoved-player-time))) 150) - (>= 20480.0 f30-0) - (>= f28-0 -4096.0) - (>= 11059.2 f28-0) - ) + (if (and (>= (- (-> *display* base-frame-counter) (the-as int (-> self last-shoved-player-time))) 150) + (>= 20480.0 f30-0) + (>= f28-0 -4096.0) + (>= 11059.2 f28-0) + ) (shove-player self *target*) ) ) @@ -273,7 +271,11 @@ ;; failed to figure out what this is: (defstate snow-bumper-deactivate (snow-bumper) :exit - (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (stop! (-> self sound)) + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (the-as (function none :behavior snow-bumper) rider-trans) :code @@ -499,10 +501,9 @@ ) (cond ((and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) - (if (and - (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> obj bumper-id)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) - ) + (if (and (= (get-reminder (get-task-control (game-task snow-bumpers)) 0) (-> obj bumper-id)) + (not (task-complete? *game-info* (-> obj entity extra perm task))) + ) (go snow-bumper-spawn-fuel-cell) (go snow-bumper-inactive-idle) ) diff --git a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc index 8afa30e03e..44d967e575 100644 --- a/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-flutflut-obs_REF.gc @@ -305,11 +305,10 @@ (local-vars (v0-2 object)) (case arg2 (('touch 'attack 'bonk) - (when (and - (= (-> arg0 type) target) - (logtest? (-> *target* control root-prim prim-core action) #x4000) - (>= 10649.6 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) - ) + (when (and (= (-> arg0 type) target) + (logtest? (-> *target* control root-prim prim-core action) #x4000) + (>= 10649.6 (vector-vector-xz-distance (-> self root-override trans) (target-pos 0))) + ) (close-specific-task! (game-task snow-ball) (task-status need-hint)) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) @@ -611,10 +610,9 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) - (when (or - (!= (-> self plat-type) 1) - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - ) + (when (or (!= (-> self plat-type) 1) + (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + ) (logclear! (-> self mask) (process-mask actor-pause)) (go flutflut-plat-appear) ) @@ -624,11 +622,10 @@ :code (behavior ((arg0 plat)) (cond - ((and - (= (-> self plat-type) 1) - (-> self entity) - (logtest? (-> self entity extra perm status) (entity-perm-status complete)) - ) + ((and (= (-> self plat-type) 1) + (-> self entity) + (logtest? (-> self entity extra perm status) (entity-perm-status complete)) + ) (set! (-> self basetrans quad) (-> self appear-trans-top quad)) (go elevator-idle-at-cave) ) @@ -719,7 +716,10 @@ (none) ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (behavior () (plat-trans) @@ -842,8 +842,7 @@ (t9-0 arg0) ) ) - (if (or - (!= (-> self plat-type) 1) + (if (or (!= (-> self plat-type) 1) (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) ) (logclear! (-> self mask) (process-mask actor-pause)) @@ -961,7 +960,11 @@ (none) ) :trans - (behavior () (plat-trans) (dummy-20 self) (none)) + (behavior () + (plat-trans) + (dummy-20 self) + (none) + ) :code (the-as (function none :behavior flutflut-plat) anim-loop) :post @@ -1017,14 +1020,12 @@ :trans (behavior () (when *target* - (if (and - (>= 798720.0 (-> (target-pos 0) y)) - (not (and - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) - ) - ) + (if (and (>= 798720.0 (-> (target-pos 0) y)) + (not (and (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) + ) + ) (go elevator-travel-to-cave) ) ) diff --git a/test/decompiler/reference/levels/snow/snow-obs_REF.gc b/test/decompiler/reference/levels/snow/snow-obs_REF.gc index 8bf25a893e..3bf50e5446 100644 --- a/test/decompiler/reference/levels/snow/snow-obs_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-obs_REF.gc @@ -1307,9 +1307,16 @@ ;; failed to figure out what this is: (defstate snow-fort-gate-activate (snow-fort-gate) :enter - (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit - (behavior () (stop! (-> self sound)) (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (stop! (-> self sound)) + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :code (behavior () (let ((gp-0 #f)) @@ -1646,7 +1653,10 @@ ;; failed to figure out what this is: (defstate snow-gears-activate (snow-gears) :trans - (behavior () (TODO-RENAME-20 self) (none)) + (behavior () + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (sound-play-by-name (static-sound-name "eng-start-up") (new-sound-id) 1024 0 0 1 #t) @@ -1708,9 +1718,15 @@ ;; failed to figure out what this is: (defstate snow-gears-halt (snow-gears) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :trans - (behavior () (TODO-RENAME-20 self) (none)) + (behavior () + (TODO-RENAME-20 self) + (none) + ) :code (behavior () (let ((a0-0 (-> self skel root-channel 0))) @@ -1898,26 +1914,26 @@ (sound-play-by-name (static-sound-name "prec-button1") (new-sound-id) 1024 -1524 0 1 #t) (let ((gp-1 (get-process *default-dead-pool* snowcam #x4000))) (set! (-> (the-as snowcam (-> (when gp-1 - (let ((t9-3 (method-of-type snowcam activate))) - (t9-3 (the-as snowcam gp-1) self 'snowcam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (new 'static 'vector :x 3411656.8 :y 779689.56 :z -13573010.0 :w 1.0) - *snowcam-sg* - "gearstart" - 0 - self - '() - ) - (-> gp-1 ppointer) - ) - 0 - ) - ) - seq - ) + (let ((t9-3 (method-of-type snowcam activate))) + (t9-3 (the-as snowcam gp-1) self 'snowcam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-1 + pov-camera-init-by-other + (new 'static 'vector :x 3411656.8 :y 779689.56 :z -13573010.0 :w 1.0) + *snowcam-sg* + "gearstart" + 0 + self + '() + ) + (-> gp-1 ppointer) + ) + 0 + ) + ) + seq + ) (the-as uint 0) ) ) @@ -2075,12 +2091,13 @@ ;; failed to figure out what this is: (defstate snow-log-wait-for-master (snow-log) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go snow-log-activate) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go snow-log-activate) + ) + ) + ) :code (behavior () (while #t @@ -2344,11 +2361,10 @@ (local-vars (v0-2 basic)) (case arg2 (('touch 'bonk 'attack) - (when (and - (= (-> arg0 type) target) - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) - ) + (when (and (= (-> arg0 type) target) + (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + (>= 6553.6 (vector-vector-xz-distance (target-pos 0) (-> self root-override trans))) + ) (process-entity-status! self (entity-perm-status complete) #t) (logclear! (-> self mask) (process-mask actor-pause)) (process-entity-status! self (entity-perm-status bit-3) #t) diff --git a/test/decompiler/reference/levels/snow/snow-ram_REF.gc b/test/decompiler/reference/levels/snow/snow-ram_REF.gc index b7402fab95..b669c9117f 100644 --- a/test/decompiler/reference/levels/snow/snow-ram_REF.gc +++ b/test/decompiler/reference/levels/snow/snow-ram_REF.gc @@ -241,7 +241,10 @@ ) ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (behavior () (rider-trans) @@ -537,10 +540,9 @@ (when (not s3-1) (when (and (-> obj entity) (logtest? (-> obj entity extra perm status) (entity-perm-status complete))) (set! s3-1 #t) - (if (and - (nonzero? (-> obj entity extra perm user-int8 2)) - (not (task-complete? *game-info* (-> obj entity extra perm task))) - ) + (if (and (nonzero? (-> obj entity extra perm user-int8 2)) + (not (task-complete? *game-info* (-> obj entity extra perm task))) + ) (birth-pickup-at-point (-> obj fuel-cell-dest-pos) (pickup-type fuel-cell) diff --git a/test/decompiler/reference/levels/snow/target-ice_REF.gc b/test/decompiler/reference/levels/snow/target-ice_REF.gc index fb292acebd..428e197864 100644 --- a/test/decompiler/reference/levels/snow/target-ice_REF.gc +++ b/test/decompiler/reference/levels/snow/target-ice_REF.gc @@ -6,7 +6,10 @@ :event target-standard-event-handler :enter - (behavior () (set! (-> self control unknown-surface00) *walk-mods*) (none)) + (behavior () + (set! (-> self control unknown-surface00) *walk-mods*) + (none) + ) :exit target-state-hook-exit :trans @@ -19,44 +22,34 @@ (remove-exit) (go target-ice-walk) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (remove-exit) (go target-duck-stance) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) @@ -79,8 +72,8 @@ (set! gp-0 21) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 71) ) (let ((a0-11 (-> self skel root-channel 0))) @@ -102,8 +95,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 51) ) (cond @@ -148,8 +141,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 78) ) (let ((a0-29 (-> self skel root-channel 0))) @@ -171,8 +164,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 84) ) (let ((a0-36 (-> self skel root-channel 0))) @@ -195,8 +188,8 @@ (set! gp-0 0) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 59) ) (set! (-> self control unknown-float81) (-> self control unknown-float80)) @@ -209,14 +202,14 @@ ) ) (set! (-> s5-0 param 0) (the float (+ (-> (the-as art-joint-anim (if (rand-vu-percent? 0.3) - (-> self draw art-group data 61) - (-> self draw art-group data 60) - ) - ) - data - 0 - length - ) + (-> self draw art-group data 61) + (-> self draw art-group data 60) + ) + ) + data + 0 + length + ) -1 ) ) @@ -280,8 +273,8 @@ (while (< 16384.0 (-> self control unknown-float01)) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 103) ) ) @@ -300,8 +293,8 @@ ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 104) ) ) @@ -335,7 +328,11 @@ (none) ) :exit - (behavior () (target-effect-exit) (target-state-hook-exit) (none)) + (behavior () + (target-effect-exit) + (target-state-hook-exit) + (none) + ) :trans (behavior () ((-> self state-hook)) @@ -343,33 +340,26 @@ (remove-exit) (go target-walk) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons l1 r1) + ) + (and (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) + (-> self control unknown-dword30) + ) + (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons l1 r1) - ) - (and - (>= (- (-> *display* base-frame-counter) (the-as int (-> *TARGET-bank* wheel-timeout))) - (-> self control unknown-dword30) - ) - (and (!= (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) stick0-speed) 0.0) (can-wheel?)) - ) - ) + ) (go target-wheel) ) - (when (and - (logtest? - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) - (pad-buttons l1 r1) - ) - (can-duck?) - ) + (when (and (logtest? (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-abs 0) + (pad-buttons l1 r1) + ) + (can-duck?) + ) (target-effect-exit) (remove-exit) (go target-duck-stance) @@ -389,34 +379,26 @@ (remove-exit) (go target-ice-stance) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-jump (-> *TARGET-bank* jump-height-min) (-> *TARGET-bank* jump-height-max) (the-as surface #f)) ) - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons circle) - ) - (can-feet?) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons circle) + ) + (can-feet?) + ) (go target-attack) ) (if (can-hands? #t) @@ -430,8 +412,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 23) ) (let ((f30-0 (ja-aframe-num 0))) @@ -447,8 +429,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 102) ) ) @@ -486,8 +468,8 @@ ) ) ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 59) ) (set! (-> self control unknown-float81) (-> self control unknown-float80)) @@ -564,7 +546,3 @@ :post (the-as (function none :behavior target) target-post) ) - - - - diff --git a/test/decompiler/reference/levels/snow/target-snowball_REF.gc b/test/decompiler/reference/levels/snow/target-snowball_REF.gc index ca05f597fb..9603d21452 100644 --- a/test/decompiler/reference/levels/snow/target-snowball_REF.gc +++ b/test/decompiler/reference/levels/snow/target-snowball_REF.gc @@ -151,5 +151,8 @@ (none) ) :post - (behavior () (target-snowball-post) (none)) + (behavior () + (target-snowball-post) + (none) + ) ) diff --git a/test/decompiler/reference/levels/snow/yeti_REF.gc b/test/decompiler/reference/levels/snow/yeti_REF.gc index 23ee88c4b3..35815f94eb 100644 --- a/test/decompiler/reference/levels/snow/yeti_REF.gc +++ b/test/decompiler/reference/levels/snow/yeti_REF.gc @@ -351,9 +351,15 @@ ;; failed to figure out what this is: (defstate yeti-slave-show-anims (yeti-slave) :trans - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :code - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :post (the-as (function none :behavior yeti-slave) transform-post) ) @@ -365,8 +371,8 @@ (behavior () (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) (ja-channel-push! 1 45) @@ -477,8 +483,8 @@ (let ((f30-0 (nav-enemy-rnd-float-range 0.9 1.1))) (cond ((= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 11) ) (let ((a0-5 (-> self skel root-channel 0))) @@ -544,10 +550,9 @@ (behavior () (set! (-> self turn-time) 60) (let ((f30-0 (nav-enemy-rnd-float-range 0.8 1.2))) - (when (or - (logtest? (-> self nav-enemy-flags) 256) - (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) - ) + (when (or (logtest? (-> self nav-enemy-flags) 256) + (and (nav-enemy-player-vulnerable?) (nav-enemy-rnd-percent? 0.5)) + ) (ja-channel-push! 1 30) (let ((gp-0 (-> self skel root-channel 0))) (set! (-> gp-0 frame-group) (the-as art-joint-anim (-> self draw art-group data 8))) @@ -591,11 +596,11 @@ (set! (-> self nav-enemy-flags) (logand -17 (-> self nav-enemy-flags))) ) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 2) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 2) + ) + ) (ja-channel-push! 1 60) ) (let ((a0-23 (-> self skel root-channel 0))) @@ -651,8 +656,8 @@ (s5-0 (target-pos 0)) ) (when (< (fabs - (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) - ) + (deg-diff (y-angle s4-0) (vector-y-angle (vector-! (new 'stack-no-clear 'vector) s5-0 (-> s4-0 trans)))) + ) 12743.111 ) (let ((a0-6 (-> self skel root-channel 0))) @@ -846,8 +851,8 @@ (let ((s5-0 (the-as (pointer process-tree) (-> obj child-process)))) (while s5-0 (if (< (vector-vector-xz-distance-squared arg0 (-> (the-as (pointer yeti-slave) s5-0) 0 collide-info trans)) - 603979800.0 - ) + 603979800.0 + ) (return #f) ) (set! s5-0 (-> s5-0 0 brother)) diff --git a/test/decompiler/reference/levels/sunken/bully_REF.gc b/test/decompiler/reference/levels/sunken/bully_REF.gc index 6293f2c63c..d9e28cbfab 100644 --- a/test/decompiler/reference/levels/sunken/bully_REF.gc +++ b/test/decompiler/reference/levels/sunken/bully_REF.gc @@ -499,14 +499,12 @@ ;; definition for function bully-post ;; INFO: Return type mismatch int vs none. (defbehavior bully-post bully () - (when (and - (-> self hit-player?) - (or (not *target*) (and - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self hit-player-time))) 15) - ) - ) - ) + (when (and (-> self hit-player?) + (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self hit-player-time))) 15) + ) + ) + ) (dummy-54 (-> self root-override) 2 2) (set! (-> self hit-player?) #f) ) @@ -562,12 +560,11 @@ (vector-normalize-copy! (-> obj nav travel) (-> obj root-override transv) 2048.0) (let ((s5-3 (new 'stack 'clip-travel-vector-to-mesh-return-info))) (dummy-24 (-> obj nav) 2048.0 s5-3) - (when (and - (-> s5-3 found-boundary) - (>= (* (-> obj travel-speed) (-> *display* seconds-per-frame)) - (vector-vector-xz-distance (-> s5-3 intersection) (-> obj root-override trans)) - ) - ) + (when (and (-> s5-3 found-boundary) + (>= (* (-> obj travel-speed) (-> *display* seconds-per-frame)) + (vector-vector-xz-distance (-> s5-3 intersection) (-> obj root-override trans)) + ) + ) (let ((s4-1 (new 'stack-no-clear 'vector))) (vector-negate! s4-1 (-> s5-3 boundary-normal)) (set! (-> s4-1 y) 0.0) @@ -617,13 +614,12 @@ ) :trans (behavior () - (when (and - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self reaction-delay))) - ) + (when (and (and *target* (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self reaction-delay))) + ) (start-hint-timer (game-text-id sunken-bully-dive-hint)) (go bully-notice) ) @@ -642,12 +638,12 @@ ) (set! (-> gp-1 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1006,9 +1002,9 @@ ) ) (if (or (not *target*) (< (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (go bully-idle #f) ) (go bully-start-spinning) diff --git a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc index 3434b0c275..90849469d4 100644 --- a/test/decompiler/reference/levels/sunken/double-lurker_REF.gc +++ b/test/decompiler/reference/levels/sunken/double-lurker_REF.gc @@ -404,15 +404,14 @@ ((TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) - ((and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - (nonzero? (-> self draw)) - (logtest? (-> self draw status) (draw-status drwf03)) - ) + ((and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (nonzero? (-> self draw)) + (logtest? (-> self draw status) (draw-status drwf03)) + ) (go-virtual nav-enemy-patrol) ) ) @@ -622,10 +621,9 @@ (let ((s4-0 (new 'stack-no-clear 'vector))) (vector-! s4-0 (target-pos 0) (-> self collide-info trans)) (cond - ((and - (>= (-> s4-0 y) 8192.0) - (>= 14563.556 (fabs (deg- (quaternion-y-angle (-> self collide-info quat)) (atan (-> s4-0 x) (-> s4-0 z))))) - ) + ((and (>= (-> s4-0 y) 8192.0) + (>= 14563.556 (fabs (deg- (quaternion-y-angle (-> self collide-info quat)) (atan (-> s4-0 x) (-> s4-0 z))))) + ) (let ((a1-4 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-4 from) self) (set! (-> a1-4 num-params) 2) @@ -645,26 +643,25 @@ ) ) (else - (when (and - ((method-of-type touching-shapes-entry prims-touching-action?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (-> (the-as target arg0) control) - (the-as uint 1) - (the-as uint 0) - ) - (let ((a1-6 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-6 from) self) - (set! (-> a1-6 num-params) 2) - (set! (-> a1-6 message) 'shove) - (set! (-> a1-6 param 0) (-> arg3 param 0)) - (let ((v1-23 (new 'static 'attack-info :mask #xc0))) - (set! (-> v1-23 shove-up) 12288.0) - (set! (-> v1-23 shove-back) 8192.0) - (set! (-> a1-6 param 1) (the-as uint v1-23)) + (when (and ((method-of-type touching-shapes-entry prims-touching-action?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (-> (the-as target arg0) control) + (the-as uint 1) + (the-as uint 0) ) - (send-event-function arg0 a1-6) - ) - ) + (let ((a1-6 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-6 from) self) + (set! (-> a1-6 num-params) 2) + (set! (-> a1-6 message) 'shove) + (set! (-> a1-6 param 0) (-> arg3 param 0)) + (let ((v1-23 (new 'static 'attack-info :mask #xc0))) + (set! (-> v1-23 shove-up) 12288.0) + (set! (-> v1-23 shove-back) 8192.0) + (set! (-> a1-6 param 1) (the-as uint v1-23)) + ) + (send-event-function arg0 a1-6) + ) + ) (level-hint-spawn (game-text-id sunken-double-lurker-hint) "sksp0127" @@ -693,9 +690,15 @@ ;; failed to figure out what this is: (defstate double-lurker-show-anims (double-lurker) :trans - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :code - (behavior () 0 (none)) + (behavior () + 0 + (none) + ) :post (the-as (function none :behavior double-lurker) transform-post) ) @@ -711,15 +714,14 @@ ((TODO-RENAME-46 self (-> self nav-info notice-distance)) (go-virtual nav-enemy-chase) ) - ((and - (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) - (nonzero? (-> self draw)) - (logtest? (-> self draw status) (draw-status drwf03)) - ) + ((and (and *target* (>= (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (-> self state-timeout)) + (nonzero? (-> self draw)) + (logtest? (-> self draw status) (draw-status drwf03)) + ) (go-virtual nav-enemy-patrol) ) ) @@ -828,7 +830,10 @@ ;; failed to figure out what this is: (defstate double-lurker-both-knocked-back (double-lurker) :enter - (behavior () (set! (-> self knocked-back-speed) 40960.0) (none)) + (behavior () + (set! (-> self knocked-back-speed) 40960.0) + (none) + ) :trans (behavior () (local-vars (at-0 int)) @@ -998,7 +1003,10 @@ ;; failed to figure out what this is: (defstate double-lurker-knocked-back (double-lurker) :enter - (behavior () (set! (-> self knocked-back-speed) 40960.0) (none)) + (behavior () + (set! (-> self knocked-back-speed) 40960.0) + (none) + ) :trans (behavior () (local-vars (at-0 int)) diff --git a/test/decompiler/reference/levels/sunken/helix-water_REF.gc b/test/decompiler/reference/levels/sunken/helix-water_REF.gc index 7b8ddb6d91..cab75e611e 100644 --- a/test/decompiler/reference/levels/sunken/helix-water_REF.gc +++ b/test/decompiler/reference/levels/sunken/helix-water_REF.gc @@ -186,12 +186,13 @@ ;; failed to figure out what this is: (defstate helix-slide-door-idle-open (helix-slide-door) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go helix-slide-door-close) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go helix-slide-door-close) + ) + ) + ) :code (behavior () (while #t @@ -317,10 +318,9 @@ (when *target* (when (logtest? (-> *target* control status) 1) (cond - ((and - (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) - (not (handle->process (-> self fcell-handle))) - ) + ((and (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete))) + (not (handle->process (-> self fcell-handle))) + ) (go helix-button-quick-activate) ) (else diff --git a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc index ee8adba689..b63e7a0905 100644 --- a/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/orbit-plat_REF.gc @@ -463,8 +463,7 @@ (cond (*target* (let ((s5-0 (target-pos 0))) - (if (or - (>= (vector-vector-xz-distance s5-0 (-> obj root-override trans)) 102400.0) + (if (or (>= (vector-vector-xz-distance s5-0 (-> obj root-override trans)) 102400.0) (>= (- (-> obj root-override trans y) (-> s5-0 y)) 16384.0) ) (return #t) @@ -664,12 +663,11 @@ (the-as symbol (cond - ((and - s5-0 - (< (vector-vector-xz-distance (the-as vector (&-> s5-0 stack 96)) (the-as vector (&-> s5-0 stack 128))) - (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans)) + ((and s5-0 + (< (vector-vector-xz-distance (the-as vector (&-> s5-0 stack 96)) (the-as vector (&-> s5-0 stack 128))) + (vector-vector-xz-distance (-> obj basetrans) (-> obj reset-trans)) + ) ) - ) (cond ((-> (the-as orbit-plat s5-0) is-reset?) (when (!= (-> obj plat-status) 2) @@ -700,9 +698,9 @@ (a1-5 (-> obj other)) ) (set! (-> v1-9 quad) (-> (the-as orbit-plat (if a1-5 - (-> a1-5 extra process) - ) - ) + (-> a1-5 extra process) + ) + ) root-override trans quad @@ -741,9 +739,9 @@ (a0-19 (-> obj other)) ) (set! (-> v1-20 quad) (-> (the-as orbit-plat (if a0-19 - (-> a0-19 extra process) - ) - ) + (-> a0-19 extra process) + ) + ) root-override trans quad diff --git a/test/decompiler/reference/levels/sunken/puffer_REF.gc b/test/decompiler/reference/levels/sunken/puffer_REF.gc index a0d370dc00..29b3af4fe9 100644 --- a/test/decompiler/reference/levels/sunken/puffer_REF.gc +++ b/test/decompiler/reference/levels/sunken/puffer_REF.gc @@ -163,14 +163,12 @@ ;; definition for function puffer-post ;; INFO: Return type mismatch int vs none. (defbehavior puffer-post puffer () - (when (and - (-> self hit-player?) - (or (not *target*) (and - (zero? (logand (-> *target* state-flags) #x80f8)) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self hit-player-time))) 15) - ) - ) - ) + (when (and (-> self hit-player?) + (or (not *target*) (and (zero? (logand (-> *target* state-flags) #x80f8)) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self hit-player-time))) 15) + ) + ) + ) (dummy-54 (-> self root-override) 2 2) (set! (-> self hit-player?) #f) ) @@ -226,10 +224,9 @@ ;; definition for method 24 of type puffer (defmethod dummy-24 puffer ((obj puffer) (arg0 vector)) - (and - (dummy-25 (-> obj nav) arg0 11468.8) - (< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top))) - ) + (and (dummy-25 (-> obj nav) arg0 11468.8) + (< (-> arg0 y) (+ (-> obj root-override trans y) (-> obj fact-info-override notice-top))) + ) ) ;; definition for method 22 of type puffer @@ -240,12 +237,11 @@ ) ) ) - (if (and - v1-0 - (>= 25395.2 - (vector-vector-xz-distance (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) - ) - ) + (if (and v1-0 + (>= 25395.2 + (vector-vector-xz-distance (-> obj root-override trans) (-> (the-as process-drawable v1-0) root trans)) + ) + ) (return #t) ) ) @@ -256,12 +252,11 @@ (defmethod dummy-25 puffer ((obj puffer) (arg0 float)) (when *target* (let ((gp-0 (target-pos 0))) - (when (and - (zero? (logand (-> *target* state-flags) #x80f8)) - (dummy-24 obj gp-0) - (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) - (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) - ) + (when (and (zero? (logand (-> *target* state-flags) #x80f8)) + (dummy-24 obj gp-0) + (>= (-> gp-0 y) (+ -14336.0 (-> obj attack-bottom-y))) + (>= (+ 2048.0 (-> obj top-y)) (-> gp-0 y)) + ) (let ((f30-0 (vector-vector-xz-distance gp-0 (-> obj root-override trans)))) (when (>= arg0 f30-0) (let* ((a0-4 (-> obj buddy)) @@ -558,14 +553,13 @@ :code (behavior () (while #t - (if (and - (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - (logtest? (-> self draw status) (draw-status drwf03)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) - ) + (if (and (and *target* (>= (-> self fact-info-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (logtest? (-> self draw status) (draw-status drwf03)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) + ) (go puffer-patrol) ) (dummy-26 self) @@ -596,14 +590,13 @@ ) :trans (behavior () - (if (and - (not (and *target* (>= (-> self fact-info-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - ) + (if (and (not (and *target* (>= (-> self fact-info-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + ) (go puffer-idle) ) (cond @@ -622,18 +615,16 @@ (set! (-> self pick-new-point-delay) (the-as uint (rand-vu-int-range 900 3000))) ) ) - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self reaction-delay))) - (dummy-25 self (-> self notice-dist)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self reaction-delay))) + (dummy-25 self (-> self notice-dist)) + ) (go puffer-attack) ) - (when (or - (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) - (>= (- (-> *display* base-frame-counter) (the-as int (-> self picked-point-time))) - (the-as int (-> self pick-new-point-delay)) - ) - ) + (when (or (< (vector-vector-xz-distance (-> self root-override trans) (-> self dest-pos)) 8192.0) + (>= (- (-> *display* base-frame-counter) (the-as int (-> self picked-point-time))) + (the-as int (-> self pick-new-point-delay)) + ) + ) (when (dummy-23 self #f) (set! (-> self picked-point-time) (the-as uint (-> *display* base-frame-counter))) (set! (-> self pick-new-point-delay) (the-as uint (rand-vu-int-range 900 3000))) @@ -872,8 +863,8 @@ ((< f30-0 0.5) (cond ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 9) ) (cond @@ -914,8 +905,8 @@ ) ) ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 11) ) (cond @@ -956,8 +947,8 @@ ) ) ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 14) ) (cond @@ -1019,8 +1010,8 @@ ) ) ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 10) ) (cond @@ -1061,8 +1052,8 @@ ) ) ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 12) ) (cond @@ -1103,8 +1094,8 @@ ) ) ((= (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) + (-> obj skel root-channel 0 frame-group) + ) (-> obj draw art-group data 13) ) (cond diff --git a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc index df27018261..287ac9620c 100644 --- a/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/qbert-plat_REF.gc @@ -135,12 +135,13 @@ ;; failed to figure out what this is: (defstate qbert-plat-on-mimic (qbert-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('die) - (go qbert-plat-on-die) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('die) + (go qbert-plat-on-die) + ) + ) + ) :code (behavior () (set-vector! (-> self draw color-emissive) 0.0 0.0 1.0 0.0) @@ -168,7 +169,10 @@ ;; failed to figure out what this is: (defstate qbert-plat-on-die (qbert-plat) :code - (behavior () '() (none)) + (behavior () + '() + (none) + ) ) ;; definition for function qbert-plat-on-init-by-other diff --git a/test/decompiler/reference/levels/sunken/shover_REF.gc b/test/decompiler/reference/levels/sunken/shover_REF.gc index c9ace576ae..176e0e20b2 100644 --- a/test/decompiler/reference/levels/sunken/shover_REF.gc +++ b/test/decompiler/reference/levels/sunken/shover_REF.gc @@ -56,11 +56,10 @@ (game-task none) ) (cond - ((or - (= (-> *target* control unknown-surface00 mode) 'air) - (>= (+ (-> *display* base-frame-counter) -60) (-> *target* control unknown-dword11)) - (< 0.75 (-> *target* control poly-normal y)) - ) + ((or (= (-> *target* control unknown-surface00 mode) 'air) + (>= (+ (-> *display* base-frame-counter) -60) (-> *target* control unknown-dword11)) + (< 0.75 (-> *target* control poly-normal y)) + ) (let ((a1-6 (new 'stack-no-clear 'event-message-block))) (set! (-> a1-6 from) self) (set! (-> a1-6 num-params) 2) diff --git a/test/decompiler/reference/levels/sunken/square-platform_REF.gc b/test/decompiler/reference/levels/sunken/square-platform_REF.gc index 2404c9c587..6bc58c0529 100644 --- a/test/decompiler/reference/levels/sunken/square-platform_REF.gc +++ b/test/decompiler/reference/levels/sunken/square-platform_REF.gc @@ -340,10 +340,9 @@ (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 (('trigger) - (if (and - (= (-> arg0 type) square-platform-master) - (= (-> (the-as square-platform-master arg0) plat-id) (-> self plat-id)) - ) + (if (and (= (-> arg0 type) square-platform-master) + (= (-> (the-as square-platform-master arg0) plat-id) (-> self plat-id)) + ) (go square-platform-rising) ) ) @@ -377,7 +376,12 @@ ) ) :enter - (behavior () (set! (-> self start-splash-time) (the-as uint 0)) (set! (-> self splash-counter) 0) 0 (none)) + (behavior () + (set! (-> self start-splash-time) (the-as uint 0)) + (set! (-> self splash-counter) 0) + 0 + (none) + ) :trans (behavior () (set! (-> self pos-u) @@ -456,7 +460,12 @@ ) ) :enter - (behavior () (set! (-> self start-splash-time) (the-as uint 0)) (set! (-> self splash-counter) 0) 0 (none)) + (behavior () + (set! (-> self start-splash-time) (the-as uint 0)) + (set! (-> self splash-counter) 0) + 0 + (none) + ) :trans (behavior () (set! (-> self pos-u) @@ -606,7 +615,12 @@ ) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -624,48 +638,46 @@ (cond ((zero? v1-7) (let* ((s5-0 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-4 - (when s5-0 - (let ((t9-3 (method-of-type sunkencam activate))) - (t9-3 (the-as sunkencam s5-0) self 'sunkencam (the-as pointer #x70004000)) + (a0-4 (when s5-0 + (let ((t9-3 (method-of-type sunkencam activate))) + (t9-3 (the-as sunkencam s5-0) self 'sunkencam (the-as pointer #x70004000)) + ) + (run-now-in-process + s5-0 + pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + ) + (-> s5-0 ppointer) + ) ) - (run-now-in-process - s5-0 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-0 ppointer) - ) - ) ) (set! (-> (the-as sunkencam (-> a0-4 0)) seq) (the-as uint 3)) ) ) ((= v1-7 1) (let* ((gp-1 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-13 - (when gp-1 - (let ((t9-6 (method-of-type sunkencam activate))) - (t9-6 (the-as sunkencam gp-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-1 ppointer) - ) - ) + (v1-13 (when gp-1 + (let ((t9-6 (method-of-type sunkencam activate))) + (t9-6 (the-as sunkencam gp-1) self 'sunkencam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-1 + pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + ) + (-> gp-1 ppointer) + ) + ) ) (set! (-> (the-as sunkencam (-> v1-13 0)) seq) (the-as uint 4)) ) @@ -673,48 +685,46 @@ ) ((= v1-7 2) (let* ((s5-1 (get-process *default-dead-pool* sunkencam #x4000)) - (a0-17 - (when s5-1 - (let ((t9-9 (method-of-type sunkencam activate))) - (t9-9 (the-as sunkencam s5-1) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - s5-1 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> s5-1 ppointer) - ) - ) + (a0-17 (when s5-1 + (let ((t9-9 (method-of-type sunkencam activate))) + (t9-9 (the-as sunkencam s5-1) self 'sunkencam (the-as pointer #x70004000)) + ) + (run-now-in-process + s5-1 + pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + ) + (-> s5-1 ppointer) + ) + ) ) (set! (-> (the-as sunkencam (-> a0-17 0)) seq) (the-as uint 5)) ) ) ((= v1-7 3) (let* ((gp-2 (get-process *default-dead-pool* sunkencam #x4000)) - (v1-24 - (when gp-2 - (let ((t9-12 (method-of-type sunkencam activate))) - (t9-12 (the-as sunkencam gp-2) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-2 - pov-camera-init-by-other - (-> self root trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-2 ppointer) - ) - ) + (v1-24 (when gp-2 + (let ((t9-12 (method-of-type sunkencam activate))) + (t9-12 (the-as sunkencam gp-2) self 'sunkencam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-2 + pov-camera-init-by-other + (-> self root trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + ) + (-> gp-2 ppointer) + ) + ) ) (set! (-> (the-as sunkencam (-> v1-24 0)) seq) (the-as uint 6)) ) @@ -778,7 +788,12 @@ (none) ) :code - (behavior () (logior! (-> self mask) (process-mask sleep-code)) (suspend) 0 (none)) + (behavior () + (logior! (-> self mask) (process-mask sleep-code)) + (suspend) + 0 + (none) + ) ) ;; definition for method 11 of type square-platform-master diff --git a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc index b1285d58ea..f2162f1e22 100644 --- a/test/decompiler/reference/levels/sunken/steam-cap_REF.gc +++ b/test/decompiler/reference/levels/sunken/steam-cap_REF.gc @@ -540,10 +540,9 @@ (let* ((a1-0 (target-pos 0)) (f0-0 (-> a1-0 y)) ) - (when (and - (>= f0-0 (+ -8192.0 (-> obj down y))) - (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) - ) + (when (and (>= f0-0 (+ -8192.0 (-> obj down y))) + (and (>= (+ -4096.0 (-> obj root-override trans y)) f0-0) (zero? (-> obj root-override riders num-riders))) + ) (let ((f0-1 (vector-vector-xz-distance-squared (-> obj down) a1-0))) (when (>= 104857600.0 f0-1) (let ((s5-0 (>= 37748736.0 f0-1))) diff --git a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc index 8793f33c10..5e92bad503 100644 --- a/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-exit-chamber_REF.gc @@ -431,10 +431,9 @@ ;; definition for method 20 of type blue-eco-charger (defmethod dummy-20 blue-eco-charger ((obj blue-eco-charger)) - (and - (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) - (send-event *target* 'query 'powerup 3) - ) + (and (and *target* (>= 16384.0 (vector-vector-distance (-> obj root-override trans) (-> *target* control trans)))) + (send-event *target* 'query 'powerup 3) + ) ) ;; failed to figure out what this is: @@ -453,17 +452,16 @@ ) (while #t (when (logtest? (-> self draw status) (draw-status drwf03)) - (if (and - (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - (let ((a1-2 (new 'stack-no-clear 'event-message-block))) - (set! (-> a1-2 from) self) - (set! (-> a1-2 num-params) 2) - (set! (-> a1-2 message) 'query) - (set! (-> a1-2 param 0) (the-as uint 'powerup)) - (set! (-> a1-2 param 1) (the-as uint 3)) - (not (send-event-function *target* a1-2)) - ) - ) + (if (and (and *target* (>= 16384.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + (let ((a1-2 (new 'stack-no-clear 'event-message-block))) + (set! (-> a1-2 from) self) + (set! (-> a1-2 num-params) 2) + (set! (-> a1-2 message) 'query) + (set! (-> a1-2 param 0) (the-as uint 'powerup)) + (set! (-> a1-2 param 1) (the-as uint 3)) + (not (send-event-function *target* a1-2)) + ) + ) (level-hint-spawn (game-text-id sunken-blue-eco-charger-hint) "sksp0125" @@ -523,12 +521,12 @@ ) (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -564,7 +562,10 @@ ;; failed to figure out what this is: (defstate blue-eco-charger-stuck-open (blue-eco-charger) :trans - (behavior () (update! (-> self sound)) (none)) + (behavior () + (update! (-> self sound)) + (none) + ) :code (behavior () (while #t @@ -578,7 +579,10 @@ ;; failed to figure out what this is: (defstate blue-eco-charger-close (blue-eco-charger) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :code (behavior () (let ((a0-0 (-> self skel root-channel 0))) @@ -603,12 +607,12 @@ ) (set! (-> self open-level) (/ (ja-frame-num 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -875,7 +879,10 @@ ) ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :code (behavior () (while #t @@ -950,7 +957,10 @@ ) ) :exit - (behavior () (logclear! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logclear! (-> self draw status) (draw-status drwf01)) + (none) + ) :code (behavior () (save-reminder (get-task-control (game-task sunken-room)) 1 0) @@ -975,7 +985,10 @@ ;; failed to figure out what this is: (defstate exit-chamber-rise (exit-chamber) :enter - (behavior () (set! (-> self move-player?) #f) (none)) + (behavior () + (set! (-> self move-player?) #f) + (none) + ) :trans (behavior () (if (not (-> self move-player?)) @@ -995,26 +1008,26 @@ (send-event *target* 'reset-pickup 'eco) (let ((gp-0 (get-process *default-dead-pool* sunkencam #x4000))) (set! (-> (the-as sunkencam (-> (when gp-0 - (let ((t9-5 (method-of-type sunkencam activate))) - (t9-5 (the-as sunkencam gp-0) self 'sunkencam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self root-override trans) - *sunkencam-sg* - "qbert-show-door-open" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - 0 - ) - ) - seq - ) + (let ((t9-5 (method-of-type sunkencam activate))) + (t9-5 (the-as sunkencam gp-0) self 'sunkencam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-0 + pov-camera-init-by-other + (-> self root-override trans) + *sunkencam-sg* + "qbert-show-door-open" + 0 + #f + '() + ) + (-> gp-0 ppointer) + ) + 0 + ) + ) + seq + ) (the-as uint 0) ) ) @@ -1189,7 +1202,10 @@ (none) ) :exit - (behavior () (logclear! (-> self mask) (process-mask platform)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask platform)) + (none) + ) :trans (behavior () (rider-trans) diff --git a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc index 02d040b6c6..2be32305f2 100644 --- a/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc +++ b/test/decompiler/reference/levels/sunken/sun-iris-door_REF.gc @@ -284,10 +284,9 @@ (go sun-iris-door-closing) ) ) - (if (and - (!= (-> self timeout) 0.0) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) - ) + (if (and (!= (-> self timeout) 0.0) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the int (* 300.0 (-> self timeout)))) + ) (go sun-iris-door-closing) ) (none) diff --git a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc index 2245753331..ae4f5a9d18 100644 --- a/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc +++ b/test/decompiler/reference/levels/sunken/sunken-obs_REF.gc @@ -235,7 +235,10 @@ (defstate pov-camera-playing (sunkencam) :virtual #t :exit - (behavior () (set! (-> *screen-filter* draw?) #f) (none)) + (behavior () + (set! (-> *screen-filter* draw?) #f) + (none) + ) :code (behavior () (let ((v1-0 (-> self seq))) @@ -566,12 +569,12 @@ ) (set! (-> s5-1 frame-num) (rand-vu-float-range 0.0 (the float (+ (-> (if (> (-> obj skel active-channels) 0) - (-> obj skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> obj skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/sunken/target-tube_REF.gc b/test/decompiler/reference/levels/sunken/target-tube_REF.gc index 889d67a599..3933544ff1 100644 --- a/test/decompiler/reference/levels/sunken/target-tube_REF.gc +++ b/test/decompiler/reference/levels/sunken/target-tube_REF.gc @@ -494,11 +494,10 @@ :exit (behavior () (when (not - (or - (= (-> self next-state name) 'target-tube) - (= (-> self next-state name) 'target-tube-jump) - (= (-> self next-state name) 'target-tube-hit) - ) + (or (= (-> self next-state name) 'target-tube) + (= (-> self next-state name) 'target-tube-jump) + (= (-> self next-state name) 'target-tube-hit) + ) ) (let ((v1-7 (-> self manipy))) (when v1-7 @@ -584,26 +583,24 @@ (countdown (s5-0 gp-0) (set! (-> self control unknown-int40) s5-0) (set! (-> self tube turn-anim-targ) (fmax -20.0 (fmin 20.0 (-> self tube turn-anim-targ)))) - (or - (not (>= (* (-> self tube turn-anim-targ) (-> self tube turn-anim-frame)) 0.0)) - (< (fabs (-> self tube turn-anim-frame)) (fabs (-> self tube turn-anim-targ))) - ) - (+! - (-> self tube turn-anim-vel) - (* (- (-> self tube turn-anim-targ) (-> self tube turn-anim-frame)) - (lerp-scale - 20.0 - (if (< (fabs (-> self tube turn-anim-frame)) (fabs (-> self tube turn-anim-targ))) - 30.0 - 60.0 - ) - (-> self control unknown-float01) - 0.0 - 36864.0 + (or (not (>= (* (-> self tube turn-anim-targ) (-> self tube turn-anim-frame)) 0.0)) + (< (fabs (-> self tube turn-anim-frame)) (fabs (-> self tube turn-anim-targ))) + ) + (+! (-> self tube turn-anim-vel) + (* (- (-> self tube turn-anim-targ) (-> self tube turn-anim-frame)) + (lerp-scale + 20.0 + (if (< (fabs (-> self tube turn-anim-frame)) (fabs (-> self tube turn-anim-targ))) + 30.0 + 60.0 + ) + (-> self control unknown-float01) + 0.0 + 36864.0 + ) + (-> *display* seconds-per-frame) ) - (-> *display* seconds-per-frame) - ) - ) + ) (set! (-> self tube turn-anim-vel) (fmax -100.0 @@ -652,19 +649,15 @@ (-> target-tube-start exit) :trans (behavior () - (if (and - (logtest? - (logior - (logior - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) - ) - (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) - ) - (pad-buttons x) - ) - (can-jump? #f) - ) + (if (and (logtest? (logior (logior (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 0) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 1) + ) + (-> *cpad-list* cpads (-> self control unknown-cpad-info00 number) button0-rel 2) + ) + (pad-buttons x) + ) + (can-jump? #f) + ) (go target-tube-jump (-> *TARGET-bank* tube-jump-height-min) (-> *TARGET-bank* tube-jump-height-max)) ) (none) @@ -707,7 +700,10 @@ (none) ) :post - (behavior () (target-tube-post) (none)) + (behavior () + (target-tube-post) + (none) + ) ) ;; failed to figure out what this is: @@ -1073,17 +1069,15 @@ ) :trans (behavior () - (if (and - (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and - (< 0.0 (vector-dot - (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self trans)) - (-> self rot) - ) - ) - (send-event *target* 'change-mode 'tube self) - ) - ) + (if (and (and *target* (>= 81920.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (and (< 0.0 (vector-dot + (vector-! (new 'stack-no-clear 'vector) (-> *target* control trans) (-> self trans)) + (-> self rot) + ) + ) + (send-event *target* 'change-mode 'tube self) + ) + ) (go-virtual slide-control-ride) ) (none) @@ -1130,12 +1124,6 @@ (process-entity-status! self (entity-perm-status bit-3) #t) (none) ) - :exit - (behavior () - (set! (-> self target) (the-as handle #f)) - (process-entity-status! self (entity-perm-status bit-3) #f) - (none) - ) :trans (behavior () (let ((gp-0 (handle->process (-> self target)))) diff --git a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc index 69c98028fd..996c7299c9 100644 --- a/test/decompiler/reference/levels/sunken/wall-plat_REF.gc +++ b/test/decompiler/reference/levels/sunken/wall-plat_REF.gc @@ -41,12 +41,13 @@ ;; failed to figure out what this is: (defstate wall-plat-retracted (wall-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('trigger) - (go wall-plat-extending) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('trigger) + (go wall-plat-extending) + ) + ) + ) :code (behavior () (set! (-> self extended-amount) 0.0) @@ -74,7 +75,10 @@ ) ) :enter - (behavior () (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) (none)) + (behavior () + (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (none) + ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code @@ -101,12 +105,13 @@ ;; failed to figure out what this is: (defstate wall-plat-extended (wall-plat) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('untrigger) - (go wall-plat-retracting) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('untrigger) + (go wall-plat-retracting) + ) + ) + ) :code (behavior () (set! (-> self extended-amount) 1.0) @@ -133,7 +138,10 @@ ) ) :enter - (behavior () (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) (none)) + (behavior () + (sound-play-by-name (static-sound-name "wall-plat") (new-sound-id) 1024 0 0 1 #t) + (none) + ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code @@ -169,9 +177,15 @@ ) ) :enter - (behavior () (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (the-as (function none :behavior wall-plat) rider-trans) :code diff --git a/test/decompiler/reference/levels/swamp/billy_REF.gc b/test/decompiler/reference/levels/swamp/billy_REF.gc index 552dbda77b..2666d57550 100644 --- a/test/decompiler/reference/levels/swamp/billy_REF.gc +++ b/test/decompiler/reference/levels/swamp/billy_REF.gc @@ -110,12 +110,12 @@ ) ) (set! (-> a0-3 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -151,12 +151,13 @@ ;; failed to figure out what this is: (defstate billy-snack-idle (billy-snack) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('eat) - (go billy-snack-eat) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('eat) + (go billy-snack-eat) + ) + ) + ) :code (behavior () (while #t @@ -166,12 +167,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -252,7 +253,10 @@ (defstate nav-enemy-idle (billy-rat) :virtual #t :enter - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) :post (the-as (function none :behavior billy-rat) nav-enemy-common-post) ) @@ -278,7 +282,10 @@ ;; failed to figure out what this is: (defstate billy-rat-eat (billy-rat) :trans - (behavior () (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 3) (none)) + (behavior () + (seek-to-point-toward-point! (-> self collide-info) (-> self destination) 131072.0 3) + (none) + ) :code (behavior () (send-event (handle->process (-> self snack)) 'eat) @@ -293,12 +300,12 @@ ) ) (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -408,7 +415,10 @@ (defstate nav-enemy-stare (billy-rat) :virtual #t :enter - (behavior () (go-virtual nav-enemy-chase) (none)) + (behavior () + (go-virtual nav-enemy-chase) + (none) + ) ) ;; failed to figure out what this is: @@ -417,8 +427,7 @@ :trans (behavior () (set! (-> self speed-scale) (-> self billy 0 rat-speed)) - (if (or - (logtest? (nav-control-flags bit19) (-> self nav flags)) + (if (or (logtest? (nav-control-flags bit19) (-> self nav flags)) (>= (- (-> *display* base-frame-counter) (-> self state-time)) (the-as int (-> self chase-rest-time))) ) (go-virtual nav-enemy-victory) @@ -426,7 +435,11 @@ (none) ) :post - (behavior () (swamp-rat-update-wiggle-target (-> self destination)) (nav-enemy-travel-post) (none)) + (behavior () + (swamp-rat-update-wiggle-target (-> self destination)) + (nav-enemy-travel-post) + (none) + ) ) ;; definition for function billy-rat-init-by-other @@ -776,7 +789,10 @@ :code (the-as (function none :behavior billy) process-taskable-anim-loop) :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; definition for function billy-game-update-wave @@ -958,12 +974,12 @@ (get-random-point (-> self path-waypts) s5-0) (let ((s4-0 (get-process *default-dead-pool* billy-rat #x4000))) (if (when s4-0 - (let ((t9-4 (method-of-type billy-rat activate))) - (t9-4 (the-as billy-rat s4-0) self 'billy-rat (the-as pointer #x70004000)) - ) - (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) - (-> s4-0 ppointer) + (let ((t9-4 (method-of-type billy-rat activate))) + (t9-4 (the-as billy-rat s4-0) self 'billy-rat (the-as pointer #x70004000)) ) + (run-now-in-process s4-0 billy-rat-init-by-other self gp-0 s5-0) + (-> s4-0 ppointer) + ) (+! (-> self num-rats) 1) ) ) @@ -1119,43 +1135,42 @@ (eval-path-curve-div! (-> self path-snacks) gp-1 (the float s5-1) 'exact) (let ((s4-1 (get-process *default-dead-pool* billy-snack #x4000))) (if (when s4-1 - (let ((t9-7 (method-of-type billy-snack activate))) - (t9-7 (the-as billy-snack s4-1) self 'billy-snack (the-as pointer #x70004000)) - ) - (run-now-in-process s4-1 billy-snack-init-by-other gp-1) - (-> s4-1 ppointer) + (let ((t9-7 (method-of-type billy-snack activate))) + (t9-7 (the-as billy-snack s4-1) self 'billy-snack (the-as pointer #x70004000)) ) + (run-now-in-process s4-1 billy-snack-init-by-other gp-1) + (-> s4-1 ppointer) + ) (+! (-> self num-snacks) 1) ) ) ) ) (backup-load-state-and-set-cmds *load-state* '()) - (let* ((gp-2 - '((kill "swamp-blimp-3") - (kill "swamp-tetherrock-14") - (kill "swamp-tetherrock-15") - (kill "flutflut-3") - (kill "tar-plat-26") - (kill "tar-plat-25") - (kill "babak-380") - (kill "eco-164") - (kill "eco-165") - (kill "eco-140") - (kill "launcher-97") - (kill "swamp-rat-nest-5") - (kill "swamp-rat-nest-4") - (kill "swamp-rat-nest-3") - (kill "swamp-rat-nest-2") - (kill "sharkey-9") - (kill "launcher-46") - (kill "launcher-44") - (kill "launcher-42") - (kill "swamp-spike-43") - (kill "swamp-spike-44") - (kill "swamp-spike-45") - ) - ) + (let* ((gp-2 '((kill "swamp-blimp-3") + (kill "swamp-tetherrock-14") + (kill "swamp-tetherrock-15") + (kill "flutflut-3") + (kill "tar-plat-26") + (kill "tar-plat-25") + (kill "babak-380") + (kill "eco-164") + (kill "eco-165") + (kill "eco-140") + (kill "launcher-97") + (kill "swamp-rat-nest-5") + (kill "swamp-rat-nest-4") + (kill "swamp-rat-nest-3") + (kill "swamp-rat-nest-2") + (kill "sharkey-9") + (kill "launcher-46") + (kill "launcher-44") + (kill "launcher-42") + (kill "swamp-spike-43") + (kill "swamp-spike-44") + (kill "swamp-spike-45") + ) + ) (a1-8 (car gp-2)) ) (while (not (null? gp-2)) @@ -1184,8 +1199,7 @@ (behavior () (while #t (billy-game-update) - (if (or - (zero? (-> self num-snacks)) + (if (or (zero? (-> self num-snacks)) (and (zero? (-> self num-rats)) (-> self passed-last-stage)) (and *cheat-mode* (cpad-pressed? 1 x)) ) @@ -1196,7 +1210,10 @@ (none) ) :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -1298,7 +1315,11 @@ (defstate play-anim (billy) :virtual #t :exit - (behavior () (billy-kill-all-but-farthy) ((-> (method-of-type process-taskable play-anim) exit)) (none)) + (behavior () + (billy-kill-all-but-farthy) + ((-> (method-of-type process-taskable play-anim) exit)) + (none) + ) ) ;; failed to figure out what this is: @@ -1307,10 +1328,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 60) ) (while #t @@ -1328,12 +1349,12 @@ ) ) (set! (-> a0-10 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1360,8 +1381,8 @@ ) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 3) ) (let ((a0-19 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/swamp/kermit_REF.gc b/test/decompiler/reference/levels/swamp/kermit_REF.gc index 488d315885..1945876526 100644 --- a/test/decompiler/reference/levels/swamp/kermit_REF.gc +++ b/test/decompiler/reference/levels/swamp/kermit_REF.gc @@ -711,9 +711,15 @@ ) ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :exit - (behavior () (sound-stop (-> self sound-id)) (none)) + (behavior () + (sound-stop (-> self sound-id)) + (none) + ) :code (behavior () (while (< (- (-> *display* base-frame-counter) (-> self state-time)) 1200) @@ -742,7 +748,10 @@ (none) ) :post - (behavior () (dummy-47 (-> self root-override)) (none)) + (behavior () + (dummy-47 (-> self root-override)) + (none) + ) ) ;; failed to figure out what this is: @@ -1168,13 +1177,17 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set! (-> self notice-time) 0) 0 (none)) + (behavior () + (set! (-> self notice-time) 0) + 0 + (none) + ) :trans (behavior () (if (and *target* (>= (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) (go kermit-patrol) ) (none) @@ -1220,13 +1233,12 @@ nav-enemy-default-event-handler ) :trans (behavior () - (if (and - (or (not *target*) (< (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) - ) + (if (and (or (not *target*) (< (-> self enemy-info idle-distance) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) + ) (go kermit-idle) ) (kermit-set-rotate-dir-to-nav-target) @@ -1274,9 +1286,15 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) (none)) + (behavior () + (set-mode! (-> self neck) (joint-mod-handler-mode look-at)) + (none) + ) :trans - (behavior () (kermit-set-rotate-dir-to-player) (none)) + (behavior () + (kermit-set-rotate-dir-to-player) + (none) + ) :code (behavior () (ja-channel-push! 1 30) @@ -1297,9 +1315,15 @@ nav-enemy-default-event-handler nav-enemy-default-event-handler ) :enter - (behavior () (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) (none)) + (behavior () + (set-mode! (-> self neck) (joint-mod-handler-mode flex-blend)) + (none) + ) :code - (behavior () (go kermit-patrol) (none)) + (behavior () + (go kermit-patrol) + (none) + ) :post kermit-simple-post ) @@ -1340,12 +1364,10 @@ nav-enemy-default-event-handler :trans (behavior () (when (not (-> self airborne)) - (if (or - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - (and - (logtest? (nav-control-flags bit19) (-> self nav flags)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) - ) + (if (or (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + (and (logtest? (nav-control-flags bit19) (-> self nav flags)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) + ) ) (go kermit-chase) ) @@ -1412,9 +1434,9 @@ nav-enemy-default-event-handler ) (when (not (-> self airborne)) (if (or (not *target*) (< (-> self enemy-info idle-distance) - (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)) + ) + ) (go kermit-patrol) ) (let ((gp-1 (kermit-check-to-hit-player? 3640.889)) @@ -1574,8 +1596,7 @@ nav-enemy-default-event-handler (let ((s5-0 (kermit-player-target-pos)) (gp-0 (kermit-tongue-pos self)) ) - (if (or - (< 73728.0 (vector-vector-distance s5-0 gp-0)) + (if (or (< 73728.0 (vector-vector-distance s5-0 gp-0)) (or (not (kermit-check-tongue-is-clear?)) (not (-> self child-override))) ) (go kermit-retract-tongue) @@ -1585,10 +1606,10 @@ nav-enemy-default-event-handler ) (when (and (-> self child-override) (let ((v1-9 (-> self child-override))) (= (-> (if v1-9 - (-> v1-9 0 self-override) - ) - type - ) + (-> v1-9 0 self-override) + ) + type + ) kermit-pulse ) ) @@ -1663,7 +1684,11 @@ nav-enemy-default-event-handler (none) ) :exit - (behavior () (set! (-> self tongue-control forward-scale-control) 0.0) (kermit-disable-tongue) (none)) + (behavior () + (set! (-> self tongue-control forward-scale-control) 0.0) + (kermit-disable-tongue) + (none) + ) :trans (behavior () (kermit-set-nav-mesh-target (-> self collide-info trans)) diff --git a/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc index d4c3b267cd..434b4932e4 100644 --- a/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-bat_REF.gc @@ -619,10 +619,9 @@ swamp-bat-slave-event-handler (defbehavior swamp-bat-check-slave-paths-match? swamp-bat ((arg0 int)) (let ((v1-0 (the-as (pointer process-tree) (-> self child-process)))) (while v1-0 - (if (and - (-> (the-as swamp-bat-slave (-> v1-0 0)) launch-ready) - (!= (-> (the-as swamp-bat-slave (-> v1-0 0)) path-select) arg0) - ) + (if (and (-> (the-as swamp-bat-slave (-> v1-0 0)) launch-ready) + (!= (-> (the-as swamp-bat-slave (-> v1-0 0)) path-select) arg0) + ) (return #f) ) (set! v1-0 (-> v1-0 0 brother)) @@ -642,13 +641,12 @@ swamp-bat-slave-event-handler (deactivate self) ) (while #t - (when (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) - *target* - (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) - ) + (when (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) + *target* + (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) (when (not (-> self child-process)) (process-entity-status! self (entity-perm-status dead) #t) (deactivate self) diff --git a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc index 600f75bc7a..2f44eac289 100644 --- a/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-obs_REF.gc @@ -173,10 +173,10 @@ (('touch) (when (-> self dangerous) (if ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 1) - ) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 1) + ) (send-event arg0 'attack (-> arg3 param 0) (new 'static 'attack-info)) ) ) @@ -235,16 +235,14 @@ ) (suspend) ) - (let ((s5-0 (or - (not *target*) - (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (let ((s5-0 (or (not *target*) + (< 204800.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) ) ) - (if (and - (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - *camera* - ) + (if (and (and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + *camera* + ) (set! s5-0 (< (* (vector4-dot gp-0 (target-pos 0)) (vector4-dot gp-0 (camera-pos))) 0.0)) ) (cond @@ -438,7 +436,11 @@ ;; failed to figure out what this is: (defstate swamp-spike-gate-down (swampgate) :code - (behavior () (process-entity-status! self (entity-perm-status complete) #t) (dummy-18 self) (none)) + (behavior () + (process-entity-status! self (entity-perm-status complete) #t) + (dummy-18 self) + (none) + ) :post (the-as (function none :behavior swampgate) swamp-spike-post) ) @@ -973,7 +975,10 @@ (defstate rigid-body-platform-idle (tar-plat) :virtual #t :enter - (behavior () (ja-channel-set! 0) (none)) + (behavior () + (ja-channel-set! 0) + (none) + ) :code (behavior () (while #t diff --git a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc index 8ec326e980..fbc099c116 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat-nest_REF.gc @@ -943,12 +943,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -993,12 +993,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1231,20 +1231,24 @@ swamp-rat-nest-default-event-handler ;; failed to figure out what this is: (defstate swamp-rat-nest-idle (swamp-rat-nest) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('hit) - (go swamp-rat-nest-active) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hit) + (go swamp-rat-nest-active) + ) + ) + ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root trans) (-> *target* control trans)) - ) - ) + (vector-vector-distance (-> self root trans) (-> *target* control trans)) + ) + ) (go swamp-rat-nest-active) ) (none) @@ -1266,7 +1270,10 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (swamp-rat-nest-check-dummy) @@ -1305,7 +1312,10 @@ swamp-rat-nest-default-event-handler :event swamp-rat-nest-default-event-handler :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (swamp-rat-nest-check-dummy) diff --git a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc index 2a4fb9741b..4ae1b010e0 100644 --- a/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc +++ b/test/decompiler/reference/levels/swamp/swamp-rat_REF.gc @@ -126,7 +126,10 @@ swamp-rat-default-event-handler :event swamp-rat-default-event-handler :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; failed to figure out what this is: @@ -286,7 +289,11 @@ swamp-rat-default-event-handler (none) ) :post - (behavior () (swamp-rat-update-wiggle-target (target-pos 0)) (nav-enemy-travel-post) (none)) + (behavior () + (swamp-rat-update-wiggle-target (target-pos 0)) + (nav-enemy-travel-post) + (none) + ) ) ;; failed to figure out what this is: @@ -471,13 +478,11 @@ swamp-rat-default-event-handler (set! f30-0 (seek f30-0 1.5 0.1)) (vector-v++! (-> self collide-info transv) gp-0) (dummy-59 (-> self collide-info) (-> self collide-info transv) (the-as uint 1) 8192.0 #t #f #f) - (when (or - (logtest? (-> self collide-info status) 4) - (or - (< (-> self collide-info trans y) (-> self min-height)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) + (when (or (logtest? (-> self collide-info status) 4) + (or (< (-> self collide-info trans y) (-> self min-height)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) + ) ) - ) 0 (goto cfg-13) ) diff --git a/test/decompiler/reference/levels/title/title-obs_REF.gc b/test/decompiler/reference/levels/title/title-obs_REF.gc index 7309f4441f..275d569ac1 100644 --- a/test/decompiler/reference/levels/title/title-obs_REF.gc +++ b/test/decompiler/reference/levels/title/title-obs_REF.gc @@ -230,11 +230,10 @@ (set! (-> self draw origin-joint-index) (the-as uint 3)) (set! (-> self draw shadow-mask) (the-as uint 255)) (set! (-> self draw global-effect) (draw-effect title)) - (when (or - (string= (-> self draw art-group name) "logo-volumes") - (string= (-> self draw art-group name) "logo-volumes-japan") - (string= (-> self draw art-group name) "logo-black") - ) + (when (or (string= (-> self draw art-group name) "logo-volumes") + (string= (-> self draw art-group name) "logo-volumes-japan") + (string= (-> self draw art-group name) "logo-black") + ) (set! (-> self main-joint) (new 'process 'joint-mod (joint-mod-handler-mode joint-set*) self 3)) (set! (-> self main-joint max-dist) (the-as meters #t)) ) @@ -614,33 +613,34 @@ (none) ) :exit - (behavior () ((-> (method-of-type logo startup) exit)) (set-blackout-frames 10) (none)) + (behavior () + ((-> (method-of-type logo startup) exit)) + (set-blackout-frames 10) + (none) + ) :trans (behavior () ((-> (method-of-type logo startup) trans)) - (if (and - *debug-segment* - (cpad-pressed? 0 start circle x) - (member (level-status *level* 'village1) '(loaded active)) - ) + (if (and *debug-segment* + (cpad-pressed? 0 start circle x) + (member (level-status *level* 'village1) '(loaded active)) + ) (set-setting! *setting-control* self 'bg-a 'abs 1.0 0) ) - (when (and - (= (-> *setting-control* current bg-a) 1.0) - (and - (member (level-status *level* 'village1) '(active loaded)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - (let ((gp-2 (level-get *level* 'village1))) - (when gp-2 - (load-state-want-levels 'title 'village1) - (load-state-want-display-level 'village1 'display-self) - (load-state-want-vis 'vi1) - (set-force-inside! *load-state* 'village1 #t) - (!= (-> gp-2 all-visible?) 'loading) - ) - ) - ) - ) + (when (and (= (-> *setting-control* current bg-a) 1.0) + (and (member (level-status *level* 'village1) '(active loaded)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + (let ((gp-2 (level-get *level* 'village1))) + (when gp-2 + (load-state-want-levels 'title 'village1) + (load-state-want-display-level 'village1 'display-self) + (load-state-want-vis 'vi1) + (set-force-inside! *load-state* 'village1 #t) + (!= (-> gp-2 all-visible?) 'loading) + ) + ) + ) + ) (load-state-want-display-level 'village1 'special) (if (not (-> self done?)) (ja-abort-spooled-anim (-> self anim) (the-as art-joint-anim #f) -1) @@ -741,7 +741,10 @@ (none) ) :post - (behavior () (ja-post) (none)) + (behavior () + (ja-post) + (none) + ) ) ;; definition for function logo-init-by-other @@ -898,10 +901,9 @@ (goto cfg-8) ) (set! (-> *setting-control* default bg-a) 0.0) - (when (or - (zero? (-> s5-2 handle)) - (and (nonzero? (-> s5-2 formatted)) (zero? (-> s5-2 inited)) (< (-> s5-2 mem-actual) (-> s5-2 mem-required))) - ) + (when (or (zero? (-> s5-2 handle)) + (and (nonzero? (-> s5-2 formatted)) (zero? (-> s5-2 inited)) (< (-> s5-2 mem-actual) (-> s5-2 mem-required))) + ) (mem-copy! (the-as pointer *auto-save-info*) (the-as pointer s5-2) 300) (set-blackout-frames 0) (let ((gp-1 7)) @@ -1074,7 +1076,3 @@ :post target-no-move-post ) - - - - diff --git a/test/decompiler/reference/levels/training/training-obs_REF.gc b/test/decompiler/reference/levels/training/training-obs_REF.gc index 9394ca992f..3489c94b8d 100644 --- a/test/decompiler/reference/levels/training/training-obs_REF.gc +++ b/test/decompiler/reference/levels/training/training-obs_REF.gc @@ -102,33 +102,29 @@ :code (behavior () (while #t - (when (and - *target* - (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) - (-> *setting-control* current play-hints) - (and - (< 0.0 (-> *setting-control* current dialog-volume)) - (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) - (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status dead)))) - ) - ) - ) + (when (and *target* + (< (vector-vector-distance (target-pos 0) (-> self root trans)) (-> self range)) + (-> *setting-control* current play-hints) + (and (< 0.0 (-> *setting-control* current dialog-volume)) + (let ((a0-3 (entity-actor-lookup (-> self entity) 'alt-actor 0))) + (or (not a0-3) (zero? (logand (-> a0-3 extra perm status) (entity-perm-status dead)))) + ) + ) + ) (when (!= (-> self index) 6) - (while (and - *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) (suspend) ) (set! (-> self state-time) (the-as uint (-> *display* base-frame-counter))) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) - (until (not (or (-> *setting-control* current talking) (or - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - ) + (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + ) ) ) (set-setting! *setting-control* self 'allow-progress #f 0.0 0) @@ -141,13 +137,12 @@ ) (copy-settings-from-target! *setting-control*) (dotimes (gp-1 2) - (while (or - (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - *progress-process* - ) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + *progress-process* + ) (suspend) ) ) @@ -353,12 +348,12 @@ ) (let ((a0-61 (-> self entity))) (if (when a0-61 - (let ((a0-62 (-> a0-61 extra perm task))) - (if a0-62 - (= a0-62 (game-task none)) - ) - ) + (let ((a0-62 (-> a0-61 extra perm task))) + (if a0-62 + (= a0-62 (game-task none)) + ) ) + ) (set! (-> self entity extra perm task) (game-task complete)) ) ) @@ -949,21 +944,18 @@ (dummy-11 a0-24 (-> self intersection)) (target-pos 0) ) - (the-as symbol (and - ((method-of-type touching-shapes-entry prims-touching?) - (the-as touching-shapes-entry (-> arg3 param 0)) - (the-as collide-shape-moving (-> self root-override)) - (the-as uint 2) - ) - (or - (= (-> self type) scarecrow-a) - (and - (= (-> arg0 type) target) - (logtest? (-> (the-as target arg0) control unknown-surface00 flags) 2048) - (zero? (logand (-> (the-as target arg0) control status) 1)) + (the-as symbol (and ((method-of-type touching-shapes-entry prims-touching?) + (the-as touching-shapes-entry (-> arg3 param 0)) + (the-as collide-shape-moving (-> self root-override)) + (the-as uint 2) ) - ) - ) + (or (= (-> self type) scarecrow-a) + (and (= (-> arg0 type) target) + (logtest? (-> (the-as target arg0) control unknown-surface00 flags) 2048) + (zero? (logand (-> (the-as target arg0) control status) 1)) + ) + ) + ) ) ) ) diff --git a/test/decompiler/reference/levels/village1/assistant_REF.gc b/test/decompiler/reference/levels/village1/assistant_REF.gc index e02ef7678f..f7a97e2793 100644 --- a/test/decompiler/reference/levels/village1/assistant_REF.gc +++ b/test/decompiler/reference/levels/village1/assistant_REF.gc @@ -151,10 +151,9 @@ ((closed? (-> obj tasks) (game-task jungle-eggtop) (task-status need-resolution)) (new 'static 'spool-anim :name "assistant-reminder-1-race-bike" :index 13 :parts 3 :command-list '()) ) - ((or - (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) - (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) - ) + ((or (closed? (-> obj tasks) (game-task misty-bike) (task-status need-resolution)) + (not (closed? (-> obj tasks) (game-task misty-bike) (task-status need-introduction))) + ) (new 'static 'spool-anim :name "assistant-reminder-1-blue-eco-switch" :index 11 :parts 3 :command-list '()) ) ((zero? (get-reminder (-> obj tasks) 2)) @@ -230,10 +229,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) (ja-channel-push! 1 60) ) (while #t @@ -251,12 +250,12 @@ ) ) (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -326,12 +325,12 @@ ) ) (set! (-> a0-28 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -363,12 +362,12 @@ (set! (-> a0-33 param 0) 0.0) (set! (-> a0-33 param 1) 1.0) (set! (-> a0-33 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village1/explorer_REF.gc b/test/decompiler/reference/levels/village1/explorer_REF.gc index a1161ee11b..9748776d38 100644 --- a/test/decompiler/reference/levels/village1/explorer_REF.gc +++ b/test/decompiler/reference/levels/village1/explorer_REF.gc @@ -204,10 +204,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 3) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 3) + ) (ja-channel-push! 1 60) ) (while #t @@ -316,12 +316,12 @@ (set! (-> a0-29 param 0) 0.0) (set! (-> a0-29 param 1) 1.0) (set! (-> a0-29 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -384,12 +384,12 @@ (set! (-> a0-39 param 0) 0.0) (set! (-> a0-39 param 1) 1.0) (set! (-> a0-39 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -501,12 +501,12 @@ (set! (-> a0-55 param 0) 0.0) (set! (-> a0-55 param 1) 1.0) (set! (-> a0-55 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc index 6e671d9d1f..989aef3557 100644 --- a/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc +++ b/test/decompiler/reference/levels/village1/fishermans-boat_REF.gc @@ -915,16 +915,13 @@ ) ) ) - (when (and - (-> self player-riding) - (and - (zero? (-> self root-overlay riders num-riders)) - (or - (not *target*) - (< 32768.0 (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans))) - ) - ) - ) + (when (and (-> self player-riding) + (and (zero? (-> self root-overlay riders num-riders)) + (or (not *target*) + (< 32768.0 (vector-vector-distance (-> self root-overlay trans) (-> *target* control trans))) + ) + ) + ) (if (process-release? *target*) (set! (-> self kill-player) #t) ) @@ -981,13 +978,12 @@ ;; definition for function fishermans-boat-leave-dock? (defbehavior fishermans-boat-leave-dock? fishermans-boat () (let ((gp-0 #f)) - (when (and - (< (vector-vector-distance (target-pos 0) (-> self rbody position)) 6144.0) - (or (task-complete? *game-info* (game-task jungle-fishgame)) (and *cheat-mode* (cpad-hold? 0 l3))) - (not (level-hint-displayed?)) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) - (file-status *art-control* (-> self anim name) 0) - ) + (when (and (< (vector-vector-distance (target-pos 0) (-> self rbody position)) 6144.0) + (or (task-complete? *game-info* (game-task jungle-fishgame)) (and *cheat-mode* (cpad-hold? 0 l3))) + (not (level-hint-displayed?)) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 900) + (file-status *art-control* (-> self anim name) 0) + ) (hide-hud) (level-hint-surpress!) (kill-current-level-hint '() '(sidekick voicebox) 'exit) @@ -1027,11 +1023,10 @@ ) ) (let ((f0-0 (vector-vector-xz-distance (-> self root-overlay trans) (-> self dock-point)))) - (when (and - (= (-> self controller path-dest-index) (-> self dock-point-index)) - (not (-> self anchored)) - (< f0-0 81920.0) - ) + (when (and (= (-> self controller path-dest-index) (-> self dock-point-index)) + (not (-> self anchored)) + (< f0-0 81920.0) + ) (set! (-> self ignition) #f) (set! (-> self anchored) #t) ) @@ -1047,7 +1042,10 @@ rigid-body-platform-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1183,7 +1181,10 @@ rigid-body-platform-event-handler ) :enter - (behavior () (set! (-> self state-time) (-> *display* base-frame-counter)) (none)) + (behavior () + (set! (-> self state-time) (-> *display* base-frame-counter)) + (none) + ) :trans (behavior () (if (fishermans-boat-leave-dock?) @@ -1345,7 +1346,11 @@ ;; failed to figure out what this is: (defstate fishermans-boat-player-control (fishermans-boat) :exit - (behavior () (send-event *camera* 'change-state *camera-base-mode* 0) (set! (-> self auto-pilot) #t) (none)) + (behavior () + (send-event *camera* 'change-state *camera-base-mode* 0) + (set! (-> self auto-pilot) #t) + (none) + ) :trans (behavior () (let ((gp-0 (new 'stack-no-clear 'vector))) @@ -1395,7 +1400,10 @@ ;; failed to figure out what this is: (defstate fishermans-boat-measurements (fishermans-boat) :exit - (behavior () (set! (-> self measure-parameters) #f) (none)) + (behavior () + (set! (-> self measure-parameters) #f) + (none) + ) :trans (behavior () (if (cpad-pressed? 1 square) @@ -1597,12 +1605,12 @@ (set! (-> obj draw origin-joint-index) (the-as uint 3)) (let ((a0-29 (-> obj entity))) (if (when a0-29 - (let ((a0-30 (-> a0-29 extra perm task))) - (if a0-30 - (= a0-30 (game-task none)) - ) - ) + (let ((a0-30 (-> a0-29 extra perm task))) + (if a0-30 + (= a0-30 (game-task none)) + ) ) + ) (set! (-> obj entity extra perm task) (game-task complete)) ) ) @@ -1718,11 +1726,10 @@ (suspend) ) ) - (while (or - (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) (suspend) ) (suspend) @@ -1743,7 +1750,12 @@ (none) ) :post - (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) (none)) + (behavior () + (ja-post) + (fishermans-boat-spawn-particles 81920.0) + (fishermans-boat-play-sounds) + (none) + ) ) ;; failed to figure out what this is: @@ -1883,5 +1895,10 @@ (none) ) :post - (behavior () (ja-post) (fishermans-boat-spawn-particles 81920.0) (fishermans-boat-play-sounds) (none)) + (behavior () + (ja-post) + (fishermans-boat-spawn-particles 81920.0) + (fishermans-boat-play-sounds) + (none) + ) ) diff --git a/test/decompiler/reference/levels/village1/sage_REF.gc b/test/decompiler/reference/levels/village1/sage_REF.gc index e318b1c69e..aceb95a09a 100644 --- a/test/decompiler/reference/levels/village1/sage_REF.gc +++ b/test/decompiler/reference/levels/village1/sage_REF.gc @@ -371,16 +371,14 @@ ;; INFO: Return type mismatch symbol vs none. (defmethod dummy-45 sage ((obj sage)) (cond - ((and - (closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) - ) + ((and (closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) + (= (get-reminder (-> obj tasks) 0) 0) + ) #t ) - ((and - (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) - ) + ((and (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) + (= (get-reminder (-> obj tasks) 0) 1) + ) #t ) ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) @@ -395,22 +393,18 @@ ;; definition for method 31 of type sage (defmethod get-art-elem sage ((obj sage)) (cond - ((and - (= (current-task (-> obj tasks)) (game-task beach-ecorocks)) - (or - (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) - ) - ) + ((and (= (current-task (-> obj tasks)) (game-task beach-ecorocks)) + (or (= (current-status (-> obj tasks)) (task-status need-hint)) + (= (current-status (-> obj tasks)) (task-status need-introduction)) + ) + ) (save-reminder (-> obj tasks) 0 0) ) - ((and - (= (current-task (-> obj tasks)) (game-task misty-cannon)) - (or - (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) - ) - ) + ((and (= (current-task (-> obj tasks)) (game-task misty-cannon)) + (or (= (current-status (-> obj tasks)) (task-status need-hint)) + (= (current-status (-> obj tasks)) (task-status need-introduction)) + ) + ) (save-reminder (-> obj tasks) 1 0) ) ((dummy-45 obj) @@ -429,10 +423,9 @@ ((closed? (-> obj tasks) (game-task beach-ecorocks) (task-status need-reminder)) (save-reminder (-> obj tasks) 1 0) ) - ((or - (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-introduction))) - ) + ((or (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-reminder)) + (not (closed? (-> obj tasks) (game-task misty-cannon) (task-status need-introduction))) + ) (save-reminder (-> obj tasks) 0 0) ) ((zero? (get-reminder (-> obj tasks) 0)) @@ -511,10 +504,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 60) ) (while #t @@ -533,12 +526,12 @@ ) ) (set! (-> a0-11 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -554,10 +547,9 @@ ) ) (until (ja-done? 0) - (if (and - (-> self reminder-played) - (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) - ) + (if (and (-> self reminder-played) + (< 81920.0 (vector-vector-distance (-> self root-override trans) (camera-pos))) + ) (go-virtual idle) ) (suspend) @@ -570,8 +562,8 @@ ) ) (when (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 4) ) (let ((a0-20 (-> self skel root-channel 0))) diff --git a/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc b/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc index c07f385163..04a26d5984 100644 --- a/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc +++ b/test/decompiler/reference/levels/village1/village-obs-VI1_REF.gc @@ -491,20 +491,17 @@ ;; definition for method 12 of type windspinner (defmethod run-logic? windspinner ((obj windspinner)) - (or - (zero? (logand (-> obj mask) (process-mask actor-pause))) - (or - (and - (nonzero? (-> obj draw)) - (logtest? (-> obj draw status) (draw-status drwf03)) - (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) - (vector-vector-distance (-> obj root 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-status drwf04))) + (or (zero? (logand (-> obj mask) (process-mask actor-pause))) + (or (and (nonzero? (-> obj draw)) + (logtest? (-> obj draw status) (draw-status drwf03)) + (>= (+ (-> *ACTOR-bank* pause-dist) (-> obj root pause-adjust-distance)) + (vector-vector-distance (-> obj root 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-status drwf04))) + ) ) - ) ) ;; failed to figure out what this is: @@ -526,11 +523,11 @@ (f0-1 (* f0-0 (+ (* f1-0 - (-> *wind-work* - wind-force - (logand (+ (the int (-> a0-0 x)) (the int (-> a0-0 z)) (-> *wind-work* wind-time)) 63) - ) - ) + (-> *wind-work* + wind-force + (logand (+ (the int (-> a0-0 x)) (the int (-> a0-0 z)) (-> *wind-work* wind-time)) 63) + ) + ) (-> self angle-vel) ) ) @@ -800,7 +797,10 @@ (none) ) :exit - (behavior () (ja-channel-set! 1) (none)) + (behavior () + (ja-channel-set! 1) + (none) + ) :trans (behavior () (if (and *target* (>= 163840.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans)))) @@ -830,8 +830,7 @@ :trans (behavior () (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 300) - (if (or - (not *target*) + (if (or (not *target*) (< 204800.0 (vector-vector-distance (-> self collide-info trans) (-> *target* control trans))) ) (go starfish-idle) @@ -1011,10 +1010,9 @@ (while #t (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 150) (set! (-> self state-time) (-> *display* base-frame-counter)) - (if (and - (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (< (process-drawable-child-count) (-> self child-count)) - ) + (if (and (and *target* (>= 204800.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (< (process-drawable-child-count) (-> self child-count)) + ) (starfish-spawn-child) ) ) diff --git a/test/decompiler/reference/levels/village1/yakow_REF.gc b/test/decompiler/reference/levels/village1/yakow_REF.gc index ff24a3de57..f3df82a15e 100644 --- a/test/decompiler/reference/levels/village1/yakow_REF.gc +++ b/test/decompiler/reference/levels/village1/yakow_REF.gc @@ -343,10 +343,9 @@ yakow-default-event-handler ) (set! (-> self travel-speed) (fmin (-> self travel-speed) (-> self final-speed))) (dummy-10 (-> self water)) - (when (and - (logtest? (-> self nav current-poly pat) 2) - (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) - ) + (when (and (logtest? (-> self nav current-poly pat) 2) + (not (and (-> self entity) (logtest? (-> self entity extra perm status) (entity-perm-status complete)))) + ) (set! (-> self in-pen) #t) (set! (-> self nav destination-pos quad) (-> self dest-base quad)) (yakow-task-complete? #t) @@ -399,11 +398,11 @@ yakow-default-event-handler (cond ((and (>= 409.6 (-> self final-speed)) (not (-> self rotating))) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 4) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 4) + ) + ) (ja-channel-push! 1 45) ) (let ((s5-0 (-> self skel root-channel 0))) @@ -427,8 +426,8 @@ yakow-default-event-handler ) ) (when (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 6) ) ) @@ -570,16 +569,15 @@ yakow-default-event-handler ) :trans (behavior () - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the-as int (-> *YAKOW-bank* default-patrol-time)) - ) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) + (the-as int (-> *YAKOW-bank* default-patrol-time)) ) - (not (yakow-facing-player? 21845.334)) - ) + (and *target* (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (not (yakow-facing-player? 21845.334)) + ) (go yakow-notice) ) (none) @@ -654,7 +652,10 @@ yakow-default-event-handler (none) ) :code - (behavior () (go yakow-run-away) (none)) + (behavior () + (go yakow-run-away) + (none) + ) :post yakow-simple-post ) @@ -674,24 +675,22 @@ yakow-default-event-handler ) :trans (behavior () - (if (and - (>= (- (-> *display* base-frame-counter) (-> self state-time)) - (the-as int (-> *YAKOW-bank* default-patrol-time)) - ) - (not (-> self in-pen)) - (and *target* (>= (-> self fact-override idle-distance) - (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) - ) + (if (and (>= (- (-> *display* base-frame-counter) (-> self state-time)) + (the-as int (-> *YAKOW-bank* default-patrol-time)) ) - (not (yakow-facing-player? 21845.334)) - ) + (not (-> self in-pen)) + (and *target* (>= (-> self fact-override idle-distance) + (vector-vector-distance (-> self root-override trans) (-> *target* control trans)) + ) + ) + (not (yakow-facing-player? 21845.334)) + ) (go yakow-notice) ) (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) 15) - (when (or - (logtest? (nav-control-flags bit19) (-> self nav flags)) - (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) - ) + (when (or (logtest? (nav-control-flags bit19) (-> self nav flags)) + (< (vector-vector-xz-distance (-> self root-override trans) (-> self nav destination-pos)) 4096.0) + ) (if (-> self in-pen) (go yakow-graze) (go yakow-idle) @@ -748,11 +747,11 @@ yakow-default-event-handler (behavior () (while (< 546.13336 (fabs (deg-diff (-> self dest-rot) (y-angle (-> self root-override))))) (if (not (= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (-> self draw art-group data 6) - ) - ) + (-> self skel root-channel 0 frame-group) + ) + (-> self draw art-group data 6) + ) + ) (ja-channel-push! 1 22) ) (seek-toward-yaw-angle! (-> self root-override) (-> self dest-rot) 16384.0 150) @@ -868,9 +867,9 @@ yakow-default-event-handler ) ) (let* ((f0-2 (* (if (-> self run-mode) - 0.5 - 1.0 - ) + 0.5 + 1.0 + ) (vector-vector-distance (-> self root-override trans) (target-pos 0)) ) ) @@ -919,7 +918,10 @@ yakow-default-event-handler (none) ) :exit - (behavior () '() (none)) + (behavior () + '() + (none) + ) :trans (behavior () (if (>= (- (-> *display* base-frame-counter) (-> self state-time)) 60) diff --git a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc index 4321208c6e..15e1aca41d 100644 --- a/test/decompiler/reference/levels/village2/assistant-village2_REF.gc +++ b/test/decompiler/reference/levels/village2/assistant-village2_REF.gc @@ -543,10 +543,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t @@ -610,12 +610,12 @@ (set! (-> a0-21 param 0) 0.0) (set! (-> a0-21 param 1) 1.0) (set! (-> a0-21 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -678,12 +678,12 @@ ) ) (set! (-> a0-35 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -715,12 +715,12 @@ (set! (-> a0-40 param 0) 0.0) (set! (-> a0-40 param 1) 1.0) (set! (-> a0-40 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -750,12 +750,12 @@ ) ) (set! (-> a0-45 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -822,7 +822,10 @@ (none) ) :trans - (behavior () '() (none)) + (behavior () + '() + (none) + ) ) ;; definition for method 39 of type assistant-bluehut @@ -1709,33 +1712,30 @@ :trans (behavior () ((-> (method-of-type process-taskable hidden) trans)) - (when (and - (cond - ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) - #t + (when (and (cond + ((and *target* (>= 61440.0 (vector-vector-distance (-> self root-override trans) (-> *target* control trans)))) + #t + ) + (else + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) + ) + (and (closed? (-> self tasks) (game-task village2-levitator) (task-status need-introduction)) + (not (closed? (-> self tasks) (game-task village2-levitator) (task-status need-reward-speech))) + (not (movie?)) + (not (level-hint-displayed?)) + (not (and *cheat-mode* (cpad-hold? 0 l3))) + (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) + ) ) - (else - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f - ) - ) - (and - (closed? (-> self tasks) (game-task village2-levitator) (task-status need-introduction)) - (not (closed? (-> self tasks) (game-task village2-levitator) (task-status need-reward-speech))) - (not (movie?)) - (not (level-hint-displayed?)) - (not (and *cheat-mode* (cpad-hold? 0 l3))) - (< (- (-> *display* base-frame-counter) (-> self state-time)) 3000) - ) - ) (hide-hud) (kill-current-level-hint '() '(sidekick voicebox) 'exit) - (when (and - (seen-text? *game-info* (game-text-id village2-not-enough-cells-levitator)) - (hud-hidden?) - (can-grab-display? self) - (not (-> *setting-control* current hint)) - ) + (when (and (seen-text? *game-info* (game-text-id village2-not-enough-cells-levitator)) + (hud-hidden?) + (can-grab-display? self) + (not (-> *setting-control* current hint)) + ) (let ((gp-0 (new 'stack 'font-context *font-default-matrix* 32 160 0.0 (font-color default) (font-flags shadow kerning)) ) @@ -1780,7 +1780,11 @@ (defstate idle (assistant-levitator) :virtual #t :exit - (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none)) + (behavior () + (stop! (-> self sound)) + ((-> (method-of-type process-taskable idle) exit)) + (none) + ) :trans (behavior () (assistant-levitator-blue-glow) @@ -1791,10 +1795,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t @@ -1834,12 +1838,12 @@ ) ) (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1895,12 +1899,12 @@ ) ) (set! (-> a0-27 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1951,10 +1955,9 @@ ;; definition for method 39 of type assistant-levitator (defmethod should-display? assistant-levitator ((obj assistant-levitator)) - (or - (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) - (zero? (get-task-status (game-task village2-levitator))) - ) + (or (= (get-task-status (game-task village2-levitator)) (task-status need-reward-speech)) + (zero? (get-task-status (game-task village2-levitator))) + ) ) ;; failed to figure out what this is: diff --git a/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc b/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc index f5bf1f29cf..61284d6e6f 100644 --- a/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc +++ b/test/decompiler/reference/levels/village2/flutflut-bluehut_REF.gc @@ -49,24 +49,27 @@ ;; definition for method 39 of type flutflut-bluehut (defmethod should-display? flutflut-bluehut ((obj flutflut-bluehut)) - (and - (closed? (-> obj tasks) (game-task village2-levitator) (task-status need-introduction)) - (task-closed? (game-task beach-flutflut) (task-status need-resolution)) - ) + (and (closed? (-> obj tasks) (game-task village2-levitator) (task-status need-introduction)) + (task-closed? (game-task beach-flutflut) (task-status need-resolution)) + ) ) ;; failed to figure out what this is: (defstate idle (flutflut-bluehut) :virtual #t :trans - (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none)) + (behavior () + (set! (-> self will-talk) #f) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t @@ -84,12 +87,12 @@ ) ) (set! (-> a0-12 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -125,12 +128,12 @@ (set! (-> a0-15 param 0) 0.0) (set! (-> a0-15 param 1) 1.0) (set! (-> a0-15 frame-num) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -189,12 +192,12 @@ ) ) (set! (-> a0-26 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village2/gambler_REF.gc b/test/decompiler/reference/levels/village2/gambler_REF.gc index 0938c6ee40..6cf86b9ce1 100644 --- a/test/decompiler/reference/levels/village2/gambler_REF.gc +++ b/test/decompiler/reference/levels/village2/gambler_REF.gc @@ -191,8 +191,8 @@ :code (behavior () (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (-> self draw art-group data 7) ) (ja-channel-push! 1 60) @@ -207,12 +207,12 @@ ) ) (set! (-> a0-9 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc b/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc index 095082aba1..fc33936bfd 100644 --- a/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc +++ b/test/decompiler/reference/levels/village2/sage-bluehut_REF.gc @@ -167,16 +167,14 @@ ) ((= (current-status (-> obj tasks)) (task-status invalid)) ) - ((and - (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 0) - ) + ((and (closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) + (= (get-reminder (-> obj tasks) 0) 0) + ) #t ) - ((and - (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (= (get-reminder (-> obj tasks) 0) 1) - ) + ((and (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) + (= (get-reminder (-> obj tasks) 0) 1) + ) #t ) ((and (-> obj reminder-played) (< 81920.0 (vector-vector-distance (-> obj root-override trans) (camera-pos)))) @@ -191,22 +189,18 @@ ;; definition for method 31 of type sage-bluehut (defmethod get-art-elem sage-bluehut ((obj sage-bluehut)) (cond - ((and - (= (current-task (-> obj tasks)) (game-task rolling-plants)) - (or - (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) - ) - ) + ((and (= (current-task (-> obj tasks)) (game-task rolling-plants)) + (or (= (current-status (-> obj tasks)) (task-status need-hint)) + (= (current-status (-> obj tasks)) (task-status need-introduction)) + ) + ) (save-reminder (-> obj tasks) 0 0) ) - ((and - (= (current-task (-> obj tasks)) (game-task swamp-arm)) - (or - (= (current-status (-> obj tasks)) (task-status need-hint)) - (= (current-status (-> obj tasks)) (task-status need-introduction)) - ) - ) + ((and (= (current-task (-> obj tasks)) (game-task swamp-arm)) + (or (= (current-status (-> obj tasks)) (task-status need-hint)) + (= (current-status (-> obj tasks)) (task-status need-introduction)) + ) + ) (save-reminder (-> obj tasks) 1 0) ) ((dummy-45 obj) @@ -215,10 +209,9 @@ ((closed? (-> obj tasks) (game-task rolling-plants) (task-status need-reminder)) (save-reminder (-> obj tasks) 1 0) ) - ((or - (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) - (not (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-introduction))) - ) + ((or (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-reminder)) + (not (closed? (-> obj tasks) (game-task swamp-arm) (task-status need-introduction))) + ) (save-reminder (-> obj tasks) 0 0) ) ((zero? (get-reminder (-> obj tasks) 0)) @@ -316,10 +309,10 @@ (cond ((= gp-0 (-> self draw art-group data 4)) (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) + (-> self skel root-channel 0 frame-group) + ) + gp-0 + ) (ja-channel-push! 1 60) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) @@ -335,12 +328,12 @@ ) ) (set! (-> a0-5 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -393,10 +386,10 @@ (else (TODO-RENAME-43 self) (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - gp-0 - ) + (-> self skel root-channel 0 frame-group) + ) + gp-0 + ) (ja-channel-push! 1 60) ) (set! (-> self skel root-channel 0 frame-group) (the-as art-joint-anim gp-0)) @@ -406,12 +399,12 @@ ) ) (set! (-> a0-16 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc index 60e90c5685..a25433c253 100644 --- a/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc +++ b/test/decompiler/reference/levels/village2/sunken-elevator_REF.gc @@ -67,26 +67,26 @@ (load-state-want-display-level 'sunken 'display) (let ((gp-0 (get-process *default-dead-pool* village2cam #x4000))) (set! (-> (the-as village2cam (-> (when gp-0 - (let ((t9-3 (method-of-type village2cam activate))) - (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) - ) - (run-now-in-process - gp-0 - pov-camera-init-by-other - (-> self spawn-pos) - *village2cam-sg* - "elevator-at-top-going-down" - 0 - #f - '() - ) - (-> gp-0 ppointer) - ) - 0 - ) - ) - seq - ) + (let ((t9-3 (method-of-type village2cam activate))) + (t9-3 (the-as village2cam gp-0) self 'village2cam (the-as pointer #x70004000)) + ) + (run-now-in-process + gp-0 + pov-camera-init-by-other + (-> self spawn-pos) + *village2cam-sg* + "elevator-at-top-going-down" + 0 + #f + '() + ) + (-> gp-0 ppointer) + ) + 0 + ) + ) + seq + ) (the-as uint 0) ) ) diff --git a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc index 6948c849ce..f53b1bd202 100644 --- a/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc +++ b/test/decompiler/reference/levels/village2/swamp-blimp_REF.gc @@ -731,10 +731,9 @@ ;; definition for method 20 of type swamp-rope (defmethod dummy-20 swamp-rope ((obj swamp-rope)) - (and - (-> obj other-entity) - (not (task-closed? (-> obj other-entity extra perm task) (task-status need-reminder))) - ) + (and (-> obj other-entity) + (not (task-closed? (-> obj other-entity extra perm task) (task-status need-reminder))) + ) ) ;; definition of type swamp-blimp @@ -805,7 +804,13 @@ ;; failed to figure out what this is: (defstate swamp-tetherrock-die (swamp-tetherrock) :code - (behavior () (dummy-18 self) (deactivate self) (suspend) 0 (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (suspend) + 0 + (none) + ) ) ;; failed to figure out what this is: @@ -984,11 +989,10 @@ (run-next-time-in-process gp-3 (lambda ((arg0 int)) - (while (or - (-> *setting-control* current ambient) - (-> *setting-control* current hint) - (-> *setting-control* current movie) - ) + (while (or (-> *setting-control* current ambient) + (-> *setting-control* current hint) + (-> *setting-control* current movie) + ) (suspend) ) (cond @@ -1251,12 +1255,13 @@ ;; failed to figure out what this is: (defstate precursor-arm-idle (precursor-arm) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('arm-sink-evt) - (go precursor-arm-sink) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('arm-sink-evt) + (go precursor-arm-sink) + ) + ) + ) :trans (behavior () (when (>= (-> self rot-t) 1.0) @@ -1469,7 +1474,10 @@ ;; failed to figure out what this is: (defstate swamp-rope-break (swamp-rope) :enter - (behavior () (set! (-> self scale-base) (-> self root scale y)) (none)) + (behavior () + (set! (-> self scale-base) (-> self root scale y)) + (none) + ) :trans (behavior () (vector<-cspace! (-> self root trans) (-> self parent-override 0 node-list data (-> self parent-rp))) diff --git a/test/decompiler/reference/levels/village2/village2-obs_REF.gc b/test/decompiler/reference/levels/village2/village2-obs_REF.gc index c6cbd23e0b..ed329f1406 100644 --- a/test/decompiler/reference/levels/village2/village2-obs_REF.gc +++ b/test/decompiler/reference/levels/village2/village2-obs_REF.gc @@ -181,7 +181,11 @@ ;; failed to figure out what this is: (defstate pontoon-die (pontoon) :code - (behavior () (dummy-18 self) (deactivate self) (none)) + (behavior () + (dummy-18 self) + (deactivate self) + (none) + ) ) ;; failed to figure out what this is: @@ -231,10 +235,9 @@ (set! (-> obj task) (the-as uint (-> arg0 extra perm task))) (set! (-> obj alt-task) (res-lump-value arg0 'alt-task uint)) (cond - ((and - (nonzero? (-> obj alt-task)) - (task-closed? (the-as game-task (-> obj alt-task)) (task-status need-resolution)) - ) + ((and (nonzero? (-> obj alt-task)) + (task-closed? (the-as game-task (-> obj alt-task)) (task-status need-resolution)) + ) (go pontoon-die) ) ((zero? (-> obj task)) @@ -627,7 +630,10 @@ (none) ) :exit - (behavior () (logior! (-> self mask) (process-mask actor-pause)) (none)) + (behavior () + (logior! (-> self mask) (process-mask actor-pause)) + (none) + ) :trans (behavior () (when (>= (ja-aframe-num 0) 500.0) @@ -641,7 +647,12 @@ (none) ) :code - (behavior ((arg0 handle)) (clone-anim arg0 3 #t "") (dummy-18 self) (deactivate self) (none)) + (behavior ((arg0 handle)) + (clone-anim arg0 3 #t "") + (dummy-18 self) + (deactivate self) + (none) + ) ) ;; failed to figure out what this is: @@ -655,7 +666,10 @@ ) ) :enter - (behavior () (logior! (-> self draw status) (draw-status drwf01)) (none)) + (behavior () + (logior! (-> self draw status) (draw-status drwf01)) + (none) + ) :code (behavior () (while #t @@ -799,9 +813,16 @@ (none) ) :exit - (behavior () (stop! (-> self sound)) (none)) + (behavior () + (stop! (-> self sound)) + (none) + ) :trans - (behavior () (fireboulder-hover-stuff) (update! (-> self sound)) (none)) + (behavior () + (fireboulder-hover-stuff) + (update! (-> self sound)) + (none) + ) :code (behavior () (while #t @@ -811,12 +832,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -854,14 +875,18 @@ ;; failed to figure out what this is: (defstate fireboulder-be-clone (fireboulder) :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('stop-cloning) - (go fireboulder-hover) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('stop-cloning) + (go fireboulder-hover) + ) + ) + ) :enter - (behavior ((arg0 handle)) (logclear! (-> self mask) (process-mask actor-pause)) (none)) + (behavior ((arg0 handle)) + (logclear! (-> self mask) (process-mask actor-pause)) + (none) + ) :exit (behavior () (logior! (-> self mask) (process-mask actor-pause)) @@ -909,12 +934,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -1089,12 +1114,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc index e8b127b420..2c26727264 100644 --- a/test/decompiler/reference/levels/village3/assistant-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/assistant-village3_REF.gc @@ -156,10 +156,10 @@ :code (behavior () (if (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - (get-art-elem self) - ) + (-> self skel root-channel 0 frame-group) + ) + (get-art-elem self) + ) (ja-channel-push! 1 15) ) (while #t diff --git a/test/decompiler/reference/levels/village3/minecart_REF.gc b/test/decompiler/reference/levels/village3/minecart_REF.gc index 6d4288e34f..8ffab21e62 100644 --- a/test/decompiler/reference/levels/village3/minecart_REF.gc +++ b/test/decompiler/reference/levels/village3/minecart_REF.gc @@ -69,12 +69,12 @@ (set! (-> gp-0 num-func) num-func-identity) (set! (-> gp-0 frame-num) (* (get-current-phase (-> self sync)) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) @@ -189,7 +189,3 @@ (minecartsteel-initialize-by-other arg0 0.0) (none) ) - - - - diff --git a/test/decompiler/reference/levels/village3/miners_REF.gc b/test/decompiler/reference/levels/village3/miners_REF.gc index b80c6125e4..02c9962ae9 100644 --- a/test/decompiler/reference/levels/village3/miners_REF.gc +++ b/test/decompiler/reference/levels/village3/miners_REF.gc @@ -4,8 +4,8 @@ ;; definition for function miners-anim-loop (defbehavior miners-anim-loop minershort () (when (!= (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) + (-> self skel root-channel 0 frame-group) + ) (get-art-elem self) ) (ja-channel-push! 1 60) @@ -121,7 +121,11 @@ (defstate idle (minertall) :virtual #t :trans - (behavior () (set! (-> self will-talk) #f) ((-> (method-of-type process-taskable idle) trans)) (none)) + (behavior () + (set! (-> self will-talk) #f) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) :code (the-as (function none :behavior minertall) miners-anim-loop) ) @@ -419,13 +423,12 @@ (let ((v1-59 s4-2)) (cond ((zero? v1-59) - (if (not (or - (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) ) - ) + ) (set! s4-2 1) ) ) @@ -435,13 +438,12 @@ ) ) ((= v1-59 2) - (if (not (or - (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) + (if (not (or (= (get-task-status (game-task village3-miner-money1)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money2)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money3)) (task-status need-reminder)) (= (get-task-status (game-task village3-miner-money4)) (task-status need-reminder)) ) - ) + ) (set! s4-2 3) ) ) @@ -706,12 +708,12 @@ ) ) (set! (-> a0-0 param 0) (the float (+ (-> (if (> (-> self skel active-channels) 0) - (-> self skel root-channel 0 frame-group) - ) - data - 0 - length - ) + (-> self skel root-channel 0 frame-group) + ) + data + 0 + length + ) -1 ) ) diff --git a/test/decompiler/reference/levels/village3/sage-village3_REF.gc b/test/decompiler/reference/levels/village3/sage-village3_REF.gc index 918c795fbb..655b72e26b 100644 --- a/test/decompiler/reference/levels/village3/sage-village3_REF.gc +++ b/test/decompiler/reference/levels/village3/sage-village3_REF.gc @@ -191,11 +191,10 @@ ) ) (else - (if (not (or - (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) + (if (not (or (= (get-task-status (game-task snow-ram)) (task-status need-reminder)) (= (get-task-status (game-task snow-ram)) (task-status need-reminder-a)) ) - ) + ) (set! s4-1 0) ) ) diff --git a/test/decompiler/reference/levels/village_common/oracle_REF.gc b/test/decompiler/reference/levels/village_common/oracle_REF.gc index 6becf3dccd..d2c82fe682 100644 --- a/test/decompiler/reference/levels/village_common/oracle_REF.gc +++ b/test/decompiler/reference/levels/village_common/oracle_REF.gc @@ -238,9 +238,17 @@ (defstate idle (oracle) :virtual #t :exit - (behavior () (stop! (-> self sound)) ((-> (method-of-type process-taskable idle) exit)) (none)) + (behavior () + (stop! (-> self sound)) + ((-> (method-of-type process-taskable idle) exit)) + (none) + ) :trans - (behavior () (update! (-> self sound)) ((-> (method-of-type process-taskable idle) trans)) (none)) + (behavior () + (update! (-> self sound)) + ((-> (method-of-type process-taskable idle) trans)) + (none) + ) ) ;; definition for method 11 of type oracle diff --git a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc index b90c1d115f..c876fdf6b6 100644 --- a/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc +++ b/test/decompiler/reference/levels/village_common/villagep-obs_REF.gc @@ -145,49 +145,47 @@ (defstate idle (warp-gate) :virtual #t :event - (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) (case arg2 - (('hide) - (go-virtual hidden) - ) - ) - ) + (behavior ((arg0 process) (arg1 int) (arg2 symbol) (arg3 event-message-block)) + (case arg2 + (('hide) + (go-virtual hidden) + ) + ) + ) :code (behavior () (clear-pending-settings-from-process *setting-control* self 'allow-progress) (set! (-> self state-time) (-> *display* base-frame-counter)) (while #t - (when (and - (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) - (and - (>= (-> self level-slot) 0) - (not (movie?)) - (not (level-hint-displayed?)) - (zero? (logand (-> *target* control root-prim prim-core action) #x7380)) - (let* ((v1-16 (-> self root)) - (a1-2 (-> *target* control trans)) - (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans)))) - ) - (or (!= (-> self level-slot) 3) (and (< f0-1 -9102.223) (< -32768.0 f0-1))) - ) - ) - ) + (when (and (and *target* (>= 20480.0 (vector-vector-distance (-> self root trans) (-> *target* control trans)))) + (and (>= (-> self level-slot) 0) + (not (movie?)) + (not (level-hint-displayed?)) + (zero? (logand (-> *target* control root-prim prim-core action) #x7380)) + (let* ((v1-16 (-> self root)) + (a1-2 (-> *target* control trans)) + (f0-1 (vector-y-angle (vector-! (new 'stack-no-clear 'vector) a1-2 (-> v1-16 trans)))) + ) + (or (!= (-> self level-slot) 3) (and (< f0-1 -9102.223) (< -32768.0 f0-1))) + ) + ) + ) (hide-hud) (level-hint-surpress!) (kill-current-level-hint '() '(sidekick voicebox) 'exit) - (when (and - (hud-hidden?) - (can-grab-display? (the-as process-taskable self)) - (cond - ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) - (set! (-> self state-time) (-> *display* base-frame-counter)) - #f + (when (and (hud-hidden?) + (can-grab-display? (the-as process-taskable self)) + (cond + ((or (= (-> *target* next-state name) 'target-warp-in) (= (-> *target* next-state name) 'target-warp-out)) + (set! (-> self state-time) (-> *display* base-frame-counter)) + #f + ) + (else + #t + ) + ) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) ) - (else - #t - ) - ) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - ) (if (and (cpad-pressed? 0 circle) (process-grab? *target*)) (go-virtual active) ) @@ -286,14 +284,12 @@ ) :trans (behavior () - (when (or - (and - (cpad-pressed? 0 triangle) - (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) - (process-release? *target*) + (when (or (and (cpad-pressed? 0 triangle) + (>= (- (-> *display* base-frame-counter) (-> self state-time)) 30) + (process-release? *target*) + ) + (not *target*) ) - (not *target*) - ) (logclear! (-> *cpad-list* cpads 0 button0-abs 0) (pad-buttons triangle)) (logclear! (-> *cpad-list* cpads 0 button0-rel 0) (pad-buttons triangle)) (sound-play-by-name (static-sound-name "cursor-options") (new-sound-id) 1024 0 0 1 #t) @@ -588,12 +584,11 @@ ) ((= v1-2 (game-task training-door)) (cond - ((and - (task-complete? *game-info* (game-task training-door)) - (task-complete? *game-info* (game-task training-gimmie)) - (task-complete? *game-info* (game-task training-climb)) - (task-complete? *game-info* (game-task training-buzzer)) - ) + ((and (task-complete? *game-info* (game-task training-door)) + (task-complete? *game-info* (game-task training-gimmie)) + (task-complete? *game-info* (game-task training-climb)) + (task-complete? *game-info* (game-task training-buzzer)) + ) #t ) (else @@ -762,12 +757,11 @@ (when (>= (- (-> *display* base-frame-counter) (-> self state-time)) #x4650) (case (-> self entity extra perm task) (((game-task training-door)) - (when (and - (task-complete? *game-info* (game-task training-door)) - (task-complete? *game-info* (game-task training-gimmie)) - (task-complete? *game-info* (game-task training-climb)) - (task-complete? *game-info* (game-task training-buzzer)) - ) + (when (and (task-complete? *game-info* (game-task training-door)) + (task-complete? *game-info* (game-task training-gimmie)) + (task-complete? *game-info* (game-task training-climb)) + (task-complete? *game-info* (game-task training-buzzer)) + ) (level-hint-spawn (game-text-id training-warp-gate-reminder) "sagevb39" @@ -1016,35 +1010,31 @@ (local-vars (v1-18 symbol)) (while #t (let ((v1-5 - (and - (and - *target* - (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) - (and - (-> *setting-control* current play-hints) - (< 0.0 (-> *setting-control* current dialog-volume)) - (let ((v1-10 (-> self index))) - (cond - ((zero? v1-10) - (and - (>= (-> *game-info* fuel) 20.0) - (not (task-closed? (game-task firecanyon-assistant) (task-status need-reward-speech))) - ) - ) - ((= v1-10 2) - (not (task-closed? (game-task village2-levitator) (task-status need-hint))) - ) - ((= v1-10 3) - (not (task-closed? (game-task village3-button) (task-status need-hint))) - ) - (else - #t + (and (and *target* + (>= (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) ) - ) - ) - ) - ) + (and (-> *setting-control* current play-hints) + (< 0.0 (-> *setting-control* current dialog-volume)) + (let ((v1-10 (-> self index))) + (cond + ((zero? v1-10) + (and (>= (-> *game-info* fuel) 20.0) + (not (task-closed? (game-task firecanyon-assistant) (task-status need-reward-speech))) + ) + ) + ((= v1-10 2) + (not (task-closed? (game-task village2-levitator) (task-status need-hint))) + ) + ((= v1-10 3) + (not (task-closed? (game-task village3-button) (task-status need-hint))) + ) + (else + #t + ) + ) + ) + ) + ) ) ) (when v1-5 @@ -1053,10 +1043,9 @@ (until v1-18 (suspend) (set! v1-18 - (or - (not *target*) - (< (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) - ) + (or (not *target*) + (< (-> self range) (vector-vector-distance (-> self root-override trans) (-> *target* control trans))) + ) ) ) (let* ((v1-23 (-> self index)) @@ -1078,24 +1067,22 @@ ) ) ) - (while (and - *target* - (logtest? (-> *target* control unknown-surface00 flags) 2048) - (zero? (logand (-> *target* control status) 1)) - ) + (while (and *target* + (logtest? (-> *target* control unknown-surface00 flags) 2048) + (zero? (logand (-> *target* control status) 1)) + ) (suspend) ) (set! (-> self state-time) (the-as uint (-> *display* base-frame-counter))) (process-grab? *target*) (process-entity-status! self (entity-perm-status bit-3) #t) (kill-current-level-hint '(ambient) '() 'exit) - (until (not (or (-> *setting-control* current talking) (or - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (-> *setting-control* current ambient) - (not *target*) - (logtest? (-> *target* state-flags) #x8008) - ) + (until (not (or (-> *setting-control* current talking) (or (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (-> *setting-control* current ambient) + (not *target*) + (logtest? (-> *target* state-flags) #x8008) + ) ) ) (set-setting! *setting-control* self 'allow-progress #f 0.0 0) @@ -1107,15 +1094,14 @@ (t9-14 a0-25 self a2-5 (the-as symbol a3-1) 0.0 0) ) (copy-settings-from-target! *setting-control*) - (while (or - (-> *setting-control* current talking) - (-> *setting-control* current spooling) - (-> *setting-control* current hint) - (!= (-> *level* loading-level) (-> *level* level-default)) - (not *target*) - (logtest? (-> *target* state-flags) #x8008) - *progress-process* - ) + (while (or (-> *setting-control* current talking) + (-> *setting-control* current spooling) + (-> *setting-control* current hint) + (!= (-> *level* loading-level) (-> *level* level-default)) + (not *target*) + (logtest? (-> *target* state-flags) #x8008) + *progress-process* + ) (suspend) ) (while (< (- (-> *display* base-frame-counter) (the-as int (-> self state-time))) 300) @@ -1283,12 +1269,12 @@ ) (let ((a0-66 (-> self entity))) (if (when a0-66 - (let ((a0-67 (-> a0-66 extra perm task))) - (if a0-67 - (= a0-67 (game-task none)) - ) - ) + (let ((a0-67 (-> a0-66 extra perm task))) + (if a0-67 + (= a0-67 (game-task none)) + ) ) + ) (set! (-> self entity extra perm task) (game-task complete)) ) ) diff --git a/test/test_pretty_print.cpp b/test/test_pretty_print.cpp index 1369b58c09..72020f1ffb 100644 --- a/test/test_pretty_print.cpp +++ b/test/test_pretty_print.cpp @@ -241,6 +241,28 @@ TEST(PrettyPrint2, ParenWayOutToTheRight) { ))"); } +TEST(PrettyPrint2, ParenWayOutToTheRight2) { + std::string code = + "(defmethod new inline-array-class ((allocation symbol) (type-to-make type) (size int)) (let " + "((obj (object-new allocation type-to-make (the-as int (+ (-> type-to-make size) (* (the-as " + "uint size) (-> type-to-make heap-base)))) ) ) ) obj ) )"; + + // checks that the c0 stuff works right. + EXPECT_EQ( + pretty_print_v2(code), + R"((defmethod new inline-array-class ((allocation symbol) (type-to-make type) (size int)) + (let ((obj (object-new + allocation + type-to-make + (the-as int (+ (-> type-to-make size) (* (the-as uint size) (-> type-to-make heap-base)))) + ) + ) + ) + obj + ) + ))"); +} + TEST(PrettyPrint2, ImproperList) { std::string code = "( ( a . b) ( c . d ) ( e f . g) . #f )"; EXPECT_EQ(pretty_print_v2(code), "((a . b) (c . d) (e f . g) . #f)"); @@ -257,4 +279,41 @@ TEST(PrettyPrint2, ImproperListMultiLine) { " .\n" " #f\n" " )"); +} + +TEST(PrettyPrint2, BreakIfBug) { + std::string code = + " (if (and (= (-> arg0 current-prt-color x) 0.0)" + " (= (-> arg0 current-prt-color y) 0.0)\n" + " (= (-> arg0 current-prt-color z) 0.0)\n" + " )\n" + " (update-mood-prt-color arg0)\n" + " )"; + EXPECT_EQ(pretty_print_v2(code, 100), + "(if (and (= (-> arg0 current-prt-color x) 0.0)\n" + " (= (-> arg0 current-prt-color y) 0.0)\n" + " (= (-> arg0 current-prt-color z) 0.0)\n" + " )\n" + " (update-mood-prt-color arg0)\n" + " )"); +} + +TEST(PrettyPrint2, AnotherBug) { + std::string code = + " (let ((f0-8 (* (fmin (vector-xz-length arg1) (* (vector-xz-length (-> s5-0 " + "trans)) arg4))\n" + " (-> *display* frames-per-second)\n" + " )\n" + " )\n" + " (t9-2 vector-xz-normalize!)\n" + " ))"; + EXPECT_EQ( + pretty_print_v2(code, 100), + "(let ((f0-8 (* (fmin (vector-xz-length arg1) (* (vector-xz-length (-> s5-0 trans)) arg4))\n" + " (-> *display* frames-per-second)\n" + " )\n" + " )\n" + " (t9-2 vector-xz-normalize!)\n" + " )\n" + " )"); } \ No newline at end of file